jQuery UI Widgets Forums Grid Grid and dropdown

This topic contains 2 replies, has 2 voices, and was last updated by  ioana 9 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Grid and dropdown #66491

    ioana
    Participant

    Hi jqWidgets Team,

    I am using a jqxDropdownList in Grid, like for example in http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/gridkeyvaluescolumnwitharray.htm.
    The selected jqxDropdownList value is not set until the user clicks outside the jqxGrid.
    Is there a way to set the value without having to click outside the jqxGrid? Something like: when a value is selected and the dropdown closes.

    For example, let’s say the selected value should be displayed in a span outside the Grid.
    The user should select the value in the dropdown and immediately see the selected value in the span.
    At the moment the user selects the value in the dropdown then clicks somewhere outside the Grid, then will see the selected value in the span.

    Here the fiddle: http://jsfiddle.net/ioana_v/3zh2azf0/4/
    Thanks,
    Ioana

    Grid and dropdown #66497

    Dimitar
    Participant

    Hello Ioana,

    To achieve this, just update your createeditor like so:

    createeditor: function(row, value, editor) {
        editor.jqxDropDownList({
            source: countriesAdapter,
            displayMember: 'label',
            valueMember: 'value'
        });
    
        editor.on('select', function(event) {
            $("#jqxgrid").jqxGrid('endcelledit', row, "countryCode", false);
        });
    }

    Best Regards,
    Dimitar

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

    Grid and dropdown #66501

    ioana
    Participant

    Hi Dimitar,

    thank you for the quick answer and the solution. It works!

    Regards,
    Ioana

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

You must be logged in to reply to this topic.