Option value (dynamic filling) in the select drop-down box of jQGrid dynamic filling)

Source: Internet
Author: User
Tags jqgrid
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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.