Re: [xul-interop] How to get second column content from tree
"Christophe Charron" <[email protected]> Sat, 21 Apr 2007 08:42:05 +0200
| Newsgroups | gmane.comp.lang.xul.general |
|---|---|
| Message-ID | <[email protected]> |
--===============1561621809== Content-Type: multipart/alternative; boundary="----=_Part_156181_32959374.1177137725180" ------=_Part_156181_32959374.1177137725180 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, try this : var tree = document.getElementById(treeID); var selection = tree.contentView.getItemAtIndex(tree.currentIndex); return tree.view.getCellText(selection,t.columns.getNamedColumn(textID)) -- Cordially, Christophe Charron 2007/4/20, Dusan Halicky <[email protected]>: > > Hi, > > I have this javascript code, which get content of first column of selected > row from tree and displat it onto component with is="texID"(e.g. label). > > function setText(treeID,textID) > { > var tree = document.getElementById(treeID); > var selection = tree.contentView.getItemAtIndex(tree.currentIndex); > var text = selection.firstChild.firstChild.getAttribute("label"); > document.getElementById(textID).value = "You selected cell: " + text > } > > But this always return first column of selected row. How can I get content > of second column? Thanks. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > XUL News Wire - http://xulnews.com > XUL Job Postings - http://xuljobs.com > Open XUL Alliance - http://xulalliance.org > _______________________________________________ > xul-talk mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/xul-talk > > ------=_Part_156181_32959374.1177137725180 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi,<br>try this : <br><br>var tree = document.getElementById(treeID);<br> var selection = tree.contentView.getItemAtIndex(tree.currentIndex);<br>return tree.view.getCellText(selection,t.columns.getNamedColumn(textID))<br><div><span class="gmail_quote"><br> -- <br>Cordially,<br>Christophe Charron<br><br>2007/4/20, Dusan Halicky <<a href="mailto:[email protected]">[email protected]</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi, <br><br>I have this javascript code, which get content of first column of selected row from tree and displat it onto component with is="texID"(e.g. label). <br><br>function setText(treeID,textID)<br>{<br> var tree = document.getElementById(treeID);<br> var selection = tree.contentView.getItemAtIndex(tree.currentIndex);<br> var text = selection.firstChild.firstChild.getAttribute("label");<br> document.getElementById(textID).value = "You selected cell: " + text <br>}<br><br>But this always return first column of selected row. How can I get content of second column? Thanks.<br> <br>-------------------------------------------------------------------------<br>This SF.net email is sponsored by DB2 Express<br>Download DB2 Express C - the FREE version of DB2 express and take<br>control of your XML. No limits. Just data. Click to get it now. <br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://sourceforge.net/powerbar/db2/" target="_blank">http://sourceforge.net/powerbar/db2/</a><br>_______________________________________________<br>XUL News Wire - <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://xulnews.com" target="_blank">http://xulnews.com</a><br>XUL Job Postings - <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://xuljobs.com" target="_blank"> http://xuljobs.com</a><br>Open XUL Alliance - <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://xulalliance.org" target="_blank">http://xulalliance.org</a><br>_______________________________________________ <br>xul-talk mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:[email protected]">[email protected]</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/xul-talk" target="_blank"> https://lists.sourceforge.net/lists/listinfo/xul-talk</a><br><br></blockquote></div><br> ------=_Part_156181_32959374.1177137725180-- --===============1561621809== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ --===============1561621809== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ XUL News Wire - http://xulnews.com XUL Job Postings - http://xuljobs.com Open XUL Alliance - http://xulalliance.org _______________________________________________ xul-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xul-talk --===============1561621809==--