JQGrid - How Can I populate dropdownlist in searchoption from MVC
I found this code for populate searchoption
editoptions: { value: "List:School" }, stype: 'select',
searchoptions: { value: "List:L开发者_JAVA百科ist Prices;School:School Prices" }
But I want to Populate it from Data in Controller use some JQuery Ajax like this
$.getJSON(url, function (data)
How can I do it.Thanks !
Look at another my answer. The dataUrl
and buildSelect
parameter of the searchoptions works exactly like the same parameter of the editoptions. So you can use the same code.
If you want have different values and display names inside of drop-down list you can make a simple modification in the code from the answer. I hope it will be no problem you you.
精彩评论