javascript - XUL Richlistbox selection issue -
i have richlistbox on firefox extension follows:
<richlistbox id="acclist" class="acclist" seltype="single" flex="1"> <richlistitem id ="acclisttemplate" hidden="true"> <listcell class="sessionactivate"/> <listcell class="nameitem"/> <listcell class="lastuseditem"/> <spacer flex="1" /> <listcell class="sessiondelete" /> <listcell class="sessioncomplete" /> <listcell class="sessiondetails" /> </richlistitem> </richlistbox>
through javascript clone richlistitem , add richlistbox values want.
the result is:
the items appear selected , not able change selection.
another weird thing is, if click on 1 of lines , do:
alert(document.getelementbyid("acclist").selectedcount);
it says 0.
am missing here?
hidden or not, list selects first item automatically - , when clone "selected" state well. easiest solution: don't put template inside <richlistbox>
tag, put somewhere outside.
Comments
Post a Comment