jQuery UI Widgets Forums Lists DropDownList Check many items

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 8 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Check many items #90034

    gusanomaly
    Participant

    Hello, I want to open it with some items checked, I’m using like this:

    $("#div_name").jqxDropDownList({
    	checkboxes: true,
    	source: dataAdapter,
    	displayMember: "status",
    	valueMember: "id_status",
    	width: "60%",
    	height: 30
    });
    
    <?php
    foreach($values as $v)
    {
    ?>
    	$("#div_name").jqxDropDownList('checkItem',"<?=$v?>");
    <?php
    }
    ?>

    I can’t show checked items, any idea? Or I’m using well this method?

    Thank you very much!
    Gustav.

    Check many items #90042

    Peter Stoev
    Keymaster

    Hi Gustav,

    I do not think this code will work. checkItem expects a valid item’s value as in our example: http://jsfiddle.net/jqwidgets/HgHaN/

    Best Regards,
    Peter Stoev

    Check many items #90058

    gusanomaly
    Participant

    Hello, I’m using like your example, but I get data from json and I’ve setting displayMember and valueMember… so if I use checkItem the value will be String (displayMember) or Integer (valueMember)???

    Or exist other way to check dinamically?

    Thank you.
    Gustav.

    Check many items #90085

    Peter Stoev
    Keymaster

    Hi Gustav,

    This “< ?=$v?>” will not work so it is not as in the example I sent you. In addition, you’re binding this through dataAdapter so there is a very good chance that you have no items when you call this method. Ensure that you try to check items when the data is loaded i.e within the bindingComplete event handler.

    Best Regards,
    Peter Stoev

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

You must be logged in to reply to this topic.