jQWidgets Forums

jQuery UI Widgets Forums Grid show/hide column : jqxDropDownList (checkboxes)

This topic contains 2 replies, has 2 voices, and was last updated by  redjane 11 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • redjane
    Member

    How to show hide columns with a jqxDropDownList and checkboxes?
    Showing the column works, but not hiding, I can not uncheck, keeps checked.

    What I have :

    $("#jqxWidget").jqxDropDownList('checkIndex', 0);
    $("#jqxDropDownList").jqxDropDownList({ autoOpen: false,checkboxes: true,source: sourcedd, selectedIndex: 0, width: '250px', height: '25px', theme: 'energyblue' });
    $('#jqxDropDownList').on('checkChange', function (event) {
    if (event.args) {
    var item = event.args.item;
    if (item) {
    if (item.value == "Hide/Show Function"){
    if (item.checked = "true") {
    $("#jqxgrid").jqxGrid('showcolumn', 'function');
    }else{
    $("#jqxgrid").jqxGrid('hidecolumn', 'function');
    }
    }
    }
    }
    });

    Peter Stoev
    Keymaster

    Hi redjane,

    I suppose that it should be:

    if (item.checked == true)
    {
    // code here
    }

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    redjane
    Member

    Thx… Oh, stupid me… still not working with ” == ” ,but without true/false its working. Easy !

    if (item.checked ) {
    $("#jqxgrid").jqxGrid('showcolumn', 'function');
    }else{
    $("#jqxgrid").jqxGrid('hidecolumn', 'function');
    }
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.