jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree jqxtree from ul with id

This topic contains 8 replies, has 2 voices, and was last updated by  Hristo 7 years, 9 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • jqxtree from ul with id #95075

    Peter__Pan
    Participant
    <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!

    jqxtree from ul with id #95085

    Hristo
    Participant

    Hello Peter__Pan,

    Could you clarify it, what you want to achieve?

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    jqxtree from ul with id #95089

    Peter__Pan
    Participant

    I want to submit IDs of checked items.

    jqxtree from ul with id #95102

    Hristo
    Participant

    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 Hristov

    jQWidgets team
    http://www.jqwidgets.com

    jqxtree from ul with id #95129

    Peter__Pan
    Participant

    But 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!

    jqxtree from ul with id #95132

    Peter__Pan
    Participant

    vertical align breaking example http://jsfiddle.net/c3ZTB/114/

    jqxtree from ul with id #95147

    Hristo
    Participant

    Hello Peter__Pan,

    Please, take a look at this demo:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/php/treeview.htm?light

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    jqxtree from ul with id #95181

    Peter__Pan
    Participant

    Hello, 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">

    jqxtree from ul with id #95201

    Hristo
    Participant

    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 Hristov

    jQWidgets team
    http://www.jqwidgets.com

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.