JQGrid: How can I refresh a dropdown after edit?

前端 未结 1 1646
温柔的废话
温柔的废话 2020-11-28 15:52

In my application, I use JQGrid for loading some contacts data, and when I edit/add an entry I select the contact\'s name from database and then update/add contact.

1条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 16:00

    I think it will be better if you would use dataUrl property of the editoptions instead of usage value property. In the case you will don't need to use synchronous Ajax call inside of onSelectRow to get the select data manually. If the data will be needed the corresponding call will do jqGrid for you.

    The URL from dataUrl should return HTML fragment for ', d = data.d, length = d.length, i = 0, item; for (; i < length; i++) { item = d[i]; html += ''; } html += ''; return html; };

    Be careful that the above code use data.d which is required in case of ASMX web services. If you would migrate to ASP.NET MVC or to WCF you will need remove the usage of d property and use data directly.

    UPDATED: Here you can download the VS2010 demo project which implements what I wrote above.

    0 讨论(0)
提交回复
热议问题