xul tree farbenie riadkov podla stplca
xul tree farbenie riadkov podla stplca
Da sa nejak spravit aby na xul stranke ktoru mam na webe (t.j. nie lokalne ani ako rozsirenie) bolo v tree mozne farbit riadky podla hodnoty v stlpci? Napr. v 1. stplci bude "red" tak cely stlpec bude cerveny. Skusal som customTreeView ale to mi vobec nezobrazi lebo hlasi security warning. Da sa to vobec?
Re: xul tree farbenie riadkov podla stplca
Toto Vam nefunguje? http://developer.mozilla.org/en/docs/XU ... ing_a_Tree
Akeho typu mate strom? http://developer.mozilla.org/en/docs/XUL:tree Pokial to ma byt stranka nahravana zo servera, tak je to tzv. remote xul a tam platia podobne opravnenia ako pri html strankach. V tom pripade je dobre sa k tom ustavat ako k html stranke, takze mate vzdy "Content tree", ktoremu urcujete podla css farbicky jednotlivych uzlov.
Akeho typu mate strom? http://developer.mozilla.org/en/docs/XUL:tree Pokial to ma byt stranka nahravana zo servera, tak je to tzv. remote xul a tam platia podobne opravnenia ako pri html strankach. V tom pripade je dobre sa k tom ustavat ako k html stranke, takze mate vzdy "Content tree", ktoremu urcujete podla css farbicky jednotlivych uzlov.
Re: xul tree farbenie riadkov podla stplca
Tu je priklad. Bohuzial neviem ako to farbenie mam spravit, aj to treechildren::-moz-tree-row snad funguje na cely tree, ja potrebujem farbit jednotlive riadky roznou farbou, nie vsetky riadky. V tomto priklade by napr. prvy datovy riadok mal byt snad zeleny:
Kód: Vybrať všetko
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
id="tree" title="tree"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<tree id="MyTree1" width="320" flex="1">
<treecols>
<treecol label="Name" flex="1"/>
<treecol label="Size" flex="1"/>
</treecols>
<treechildren style="background: gray;">
<treeitem style="background: red;">
<treerow style="background: green;">
<treecell label="Popcorn" style="background: blue;"/>
<treecell label="Large"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Root Beer"/>
<treecell label="Small"/>
</treerow>
</treeitem>
</treechildren>
</tree>
</window>
Re: xul tree farbenie riadkov podla stplca
tree.css:
tree.xul
Kód: Vybrať všetko
treechildren::-moz-tree-row(modry) {
background: blue;
}
treechildren::-moz-tree-row(zeleny) {
background: green;
}
treechildren::-moz-tree-row(ramcekovy) {
border: 10px solid red;
}
Kód: Vybrať všetko
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="tree.css" type="text/css"?>
<window
id="tree" title="tree"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<tree id="MyTree1" width="320" flex="1">
<treecols>
<treecol label="Name" flex="1"/>
<treecol label="Size" flex="1"/>
</treecols>
<treechildren style="treechildren::-moz-tree-row(odd).border: green 1px solid;">
<treeitem>
<treerow properties="modry">
<treecell label="Popcorn"/>
<treecell label="Large"/>
</treerow>
</treeitem>
<treeitem>
<treerow properties="zeleny">
<treecell label="Root Beer"/>
<treecell label="Small"/>
</treerow>
</treeitem>
<treeitem>
<treerow properties="ramcekovy modry">
<treecell label="Foo"/>
<treecell label="Bar"/>
</treerow>
</treeitem>
</treechildren>
</tree>
</window>