1

I'm trying to dynamically load values into a select in a jqGrid. It almost works. The problem is that the values that are returned from the server, are not displayed until the user change row! When I debug, I can see the correc values are being set, but the selection list does not update! Using IE9.

        $("#my_grid").setColProp("master_col", { editoptions: { value: data.verksamheter, dataEvents:
        [
            { type: 'change', fn: function (e) {
                var url = '@Url.Action("GetData", "Controller")'
                $.getJSON(url, { id: e.srcElement.value }, function (data) {
                    $("#my_grid").setColProp("details_col", { editoptions: { value: data.verksamhetsslag} });

                });

            } 
            }
        ]
        }
        });
kaze
  • 4,299
  • 12
  • 53
  • 74

1 Answers1

0

If you need to update the select list of one column ("details_col") during the editing is already started, for example if you need update the select list of the column "details_col" is the user changes the option in select of another column ("master_col"), you have to do this manually. Just setting of new value of editoptions is not enough.

In the answer I demonstrated how to do this. The code is not short, but the steps are really required.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798