Home  >  Article  >  Web Front-end  >  How to query and display the content of the select drop-down box in MIUI?

How to query and display the content of the select drop-down box in MIUI?

坏嘻嘻
坏嘻嘻Original
2018-09-13 14:44:481882browse

How do we use the select drop-down box to display content in MIUI? The content of the article is very compact, I hope you will study patiently.


1. Select drop-down box style in JSP

# 2. Code in js

1.

//定义一个function ,将不同的codeType写入,如“课程状态”等你想要通过下拉框展示的字段都通过codeType="  "表示
 $(document).ready(function(){      
     showList(codeType="if_teacher_sequence"); 
              showList(codeType="course_state");  
                  });

2.

//定义showList函数,将codeType作为值传入
      function showList(codeType) {    
         $.ajax({    
            type : 'GET',   
                url : ctx + "/api/defCode/"+codeType+".do", 
            //跳转到controller通过方法查询出结果     
            success : function(data) {  
            //成功之后返回结果到data  
              status_list = data;   
               mini.get(codeType).setData(status_list);
              //miui的setData方法通过course_state字段名称将值赋给JSP中的对应字段并显示出来 
                   }  
                    })  
                       };

Related recommendations:

jquery operation select (add, delete, clear)

Detailed explanation of the select method in jquery

The above is the detailed content of How to query and display the content of the select drop-down box in MIUI?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn