Steve Dyke
Steve Dyke

Reputation: 175

Dynamically Change Populate Select List after Edit From Displays

I am using jqGrid 4.15.6-pre

I have a Select list in my edit form that populates using dataURL in the onSelect function based on a couple of parameters. There is a input element on the edit form that has a function bound to it that can change one of the parameter(customerReturnType) values. I would like to programmatically repopulate the Select List based on the new parameter value.

Here is my onSelect code:

locationCheckOverride = false;
        customerReturnLocation = $("#customerReturnqueue").getRowData(id)['crrLocation'];
        customerReturnType = $("#customerReturnqueue").getRowData(id)['crrType'];
        editModeOverride = $("#customerReturnqueue").getRowData(id)['editModeOverride'];
        holdingLocationEditOnly = $("#customerReturnqueue").getRowData(id)['editHoldingLocationOnly'];
        
        $("#customerReturnqueue").setColProp('crrLocation', {
         editoptions: {
            dataUrl: '/QMSWebApp/CustomerReturnRecordsControllerServletV8?lifecycle=customerReturnLocationOptionsLessInitialized&currentLocation='+customerReturnLocation+'&crrType='+customerReturnType,
            selectFilled: function (options) {
                $(options.elem).select2({
                    dropdownCssClass: 'ui-widget ui-jqdialog zclassX2',
                    width: 300
                });
        }}});  

Upvotes: 1

Views: 91

Answers (1)

Tony Tomov
Tony Tomov

Reputation: 3277

If I correctly understand the problem you want to dynamically change the select based on a change new value.

Here is example in Guriddo jqGrid, but it should work in free-jqgrid. This is just a idea how you can do this.

Upvotes: 0

Related Questions