jQWidgets Forums
jQuery UI Widgets › Forums › Navigation › Tree › jqxtree from ul with id
Tagged: #jquery-tree, javascript tree, jqwidgets tree, jqxtree ids, Tree
This topic contains 8 replies, has 2 voices, and was last updated by Hristo 7 years, 9 months ago.
-
Authorjqxtree from ul with id Posts
-
<div id='jqxTree' style='visibility: hidden; float: left; margin-left: 20px;'> <ul> <li>Home</li> //ID=1 <li item-expanded='true'>Solutions //ID=2 <ul> <li item-checked="true">Education</li> //ID=3 <li>Financial services</li> //ID=4 </ul> </li> </ul> </div>
If I want to post only ID instead names what html should I use?
If i try so
<div id='jqxTree' style='visibility: hidden; float: left; margin-left: 20px;'> <ul> <li id="1">Home</li> <li item-expanded='true' id="2">Solutions <ul> <li item-checked="true" id="3">Education</li> <li id="3">Financial services</li> </ul> </li> </ul> </div>
i’ m getting vertical alignment breaking in second level LI, but in first level it is ok!
Hello Peter__Pan,
Could you clarify it, what you want to achieve?
Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comI want to submit IDs of checked items.
Hello Peter__Pan,
You could use “getCheckedItems” –
var items = $('#jqxTree').jqxTree('getCheckedItems');
All ‘item’ in this array of items has “element” field that has id and you could extract the desired information from there.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comBut by default there are labels in hidden field that was submitted. How can I switch it to Ids?
Ok, I answer again. I have html ul and li inside.
I build this ul from my DB.
And when I checked items I want to put IDs (not text) in hidden input value and then submit it!vertical align breaking example http://jsfiddle.net/c3ZTB/114/
Hello Peter__Pan,
Please, take a look at this demo:
http://www.jqwidgets.com/jquery-widgets-demo/demos/php/treeview.htm?lightBest Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHello, Hristo
Certanly, I have been seen this demo before I wrote my question here.
But in your demo there is the input field that is submited
<input type="hidden" name="tree" value="Solutions,Education,Manufacturing,PC products">
A want to submit not text values, but IDs!
For example<input type="hidden" name="tree" value="1,4,6,7">
Hello Peter__Pan,
Unfortunately, there is no such option.
I would suggest you use the approach from my previous post, collect these ids in one hidden input and send this data to the server (with AJAX).Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.