I have an asp.net-mvc site and Iam using jqgrid, and I have a few fields where the edit control is a dropdown. I have an issue where the name int the dropdown is dependent comes from another column so I need to force a refresh from the server every time I bring up the edit form or if I click on the "+" to add a new entry to make sure the correct string is being shown.
I am seeing an issue where Internet Explorer seems to cache my dropdown list even if i try very hard to tell it not to. I don't observe the issue in Firefox or Chrome.
Here is my code:
The Col MODEL row that I a am observing the issue:
{ name: "SiteSettings", index: "SiteSettings", width: 250, editable: true,
edittype: "select", editoptions: { dataUrl: "/SiteSettings/GetSelectData" },
editrules: { edithidden: true, required: false} },
And here is the code to construct the edit button and add button
onClickButton: function () {
jQuery("#grid").jqGrid('editGridRow', "new", { recreateForm: true, url: '/MyController/Add', afterSubmit: function (response, postdata) {
var responseJson = $.parseJSON(response.responseText);
return HandleJqGridAddResponse(responseJson);
}, height: 380, width: "auto", closeAfterAdd: true, reloadAfterSubmit: true
});
},
jQuery("#grid").jqGrid('editGridRow', id,
{ url: '/MyController/Update', afterSubmit: function (response, postdata) {
var responseJson = $.parseJSON(response.responseText);
return HandleJqGridResponse(responseJson);
},
height: 380, width: "auto", recreateForm: true, closeAfterEdit: true,
closeOnEscape: true, reloadAfterSubmit: true
});
I thought
recreateForm: true
or
$("#grid").jqGrid({
ajaxSelectOptions: { cache: false }
});
would do the trick but it doesn't seem to make any difference.
but I have observed that when I bring up the edit form or the new form, that the function on my backend is NOT being called to return the list of items for the dropdown so there must be some client side caching.
How can I force a refresh of the dataurl (dataUrl: "/SiteSettings/GetSelectData") each time i try to edit or add a new entry?