jQWidgets Forums

jQuery UI Widgets Forums Grid How to create a drop-down on the column header

This topic contains 4 replies, has 3 voices, and was last updated by  nitinayir8 9 years, 8 months ago.

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

  • aldo86
    Participant

    Hi,
    I need to edit header columns with a dropdown to map my column data. Is it possible? In alternative I could add a different new row like a special row to use for that. How can I do?

    Thanks


    Peter Stoev
    Keymaster

    Hi aldo86,

    Unfortunately, this is not possible in this widget.

    Best Regards,
    Peter Stoev

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


    aldo86
    Participant

    Hi,
    I’ve found a workaround. I’ve used render to redefine the header column like this

    var columnrenderer = function (value) {
    return ‘<div class=”columnH” id=”‘+value+'” style=”margin:0 auto”></div>’;
    }

    and then I’ve called the dropdown like this

    $(“.columnH”).livequery(function(){
    $(this).jqxDropDownList({ source: dropdownH, selectedIndex: 1, width: 200, height: ’25’});
    });

    What do you think? Is it a good solution? Some suggestion?

    Best regards
    Aldo


    Peter Stoev
    Keymaster

    Hi Aldo,

    No, I don’t think this is a good solution, but if it is good for you, you can use it as a workaround. I don’t think that it is good because in some cases the Grid needs to re-render itself and your code will fail in that case.

    Best Regards,
    Peter Stoev

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


    nitinayir8
    Participant

    Hi @aldo86/ Peter,

    I have implemented header column name change using @aldo86 approach, everything works perfectly fine except when i select already existing value from dropdown, dropdown doesn’t go.
    E.g.
    Consider i have 4 values in my drodown i.e 1, 2, 3, 4 and already selected value is “2”. Now i select value “1” from dropdown list, everything works fine, i am able to come out of the dropdown list. But when i select again value “2” from dropdown list, which was my default value, dropdown doesn’t go

    Can you help us to resolve this issue, if you had faced the same.

    Thanks,
    Nitin Ayir

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

You must be logged in to reply to this topic.