Ok I came back to this, I just removed the formatter: "select", which was requiring a matched state key to display in the grid.
Ok I give up, my solution is:
search: false, editable: false
until the new version of JQGrid.
Ok, so looking at Oleg's code, it seems the solution there is to initially populate the state select with every possible value for all countries. Given that there are quite a few "states" (worldwide) that I deal with, it's a bit kludgy to pull down 3-4000 states just to find a match to the actual cell value. Still working on this.
I have dependent country and state dropdowns (both toolbar search, inline edit, and form edit). I am having a problem getting the row id in the datainit function, so that I can retrieve the country value from the datainit function of the state searchoptions/editoptions.
Surely there's a way to retrieve this? I tried setting a timeout as well, no luck:
{ name: "State", index: "MYSTATE", width: 50, align: "left", editable: true, formatter: "select", stype: "select", edittype: "select", sortable: true, editrules: { required: true, custom: true, custom_func: validateState },
searchoptions:
{
value: GetStates('NG', true), // just hardcoded here for now
dataInit: function (elem)
{
var rowId = $(elem.target).closest('tr.jqgrow').attr('id');
var country = grid.jqGrid('getCell', rowId, 'Country');
...
Thanks.