This article mainly introduces the option value (Dynamic fill) of the select drop-down box for dynamic filling of jQGrid, which is very good and has reference value, you can refer to this article to share a piece of code. Tips: dynamic filling of the select drop-down box option values in jqgrid. I will not talk about it much, but I will directly post the code to you. The specific code is as follows:
Function gettypes () {// dynamically generate select Content var str = ""; $. ajax ({type: "post", async: false, url: "checkpersontype", success: function (data) {if (data! = Null) {var jsonobj = eval (data); var length = jsonobj. length; for (var I = 0; I
"+ Jsonobj [I]. personType +" "). appendTo (typeselect); //}) ;}alert (str) ;}); return str ;}
Note: return and async: false. Otherwise, the result will be ineffective.
Set edittype: 'select', editoptions: {value: gettypes ()} In colModel.
The preceding section describes the option value (dynamic filling) of the jQGrid dynamic filling select drop-down box. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. I would like to thank you for your support for PHP chinnet!
For more articles about the option value (dynamic filling) in the select drop-down box of jQGrid dynamic filling, please refer to PHP!