easyui combobox 赋值,取值,默认选中。

easyui combobox 赋值,取值,默认选中。//赋值(多选下拉框选中)$(‘#tvType’).combobox(‘setValues’,值.split(‘,’));//多选下拉框选中<inputclass=”easyui-combobox”style=”width:137px”…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全家桶1年46,售后保障稳定

             //赋值(多选下拉框选中)          

            $(‘#tvType’).combobox(‘setValues’,值.split(‘,’)); 

           //多选下拉框选中

             <input class=”easyui-combobox” style=”width: 137px”
                                name=”countryRegionCode” id=”originalCountry” data-options=”multiple:true”></input>

            //取值(多选下拉框选中)

           $(“#originalCountry”).combobox(‘getValues’);

            //取值(单选下拉框选中)

            //valueField和textField同一属性值。$(‘#programType’).combobox(‘getValue’)获取的值为textField值。

 

          //  默认选中(单选下拉框)

          $(‘#upType’).combobox(‘select’,‘值’);

            var re = $ht.form.ajaxS(ctx + “/common/fetchProgramType”,null,”json”);
            if(re ==”noRight”){

                return;
            }
            var typeList = new Array();
            typeList.push({ “type”:”-1″, “type”: “全部” });
            if(re.programList!=null&&re.programList!=’null’){

                  typeList.push.apply(typeList,re.programList);
            }
            $(“#programType”).combobox({

                data:typeList,
                valueField:’type’,
                textField:’type’
            });
            $(‘#programType’).combobox(‘select’, typeList[0].type);

           var programtype = $(‘#programType’).combobox(‘getValue’);
           if(programtype==’全部’){

              programtype=-1;
            }

            // 播放设置(方式一:默认选中)
              var d = {dictType:”playFlg”};
              var r = $ht.form.ajaxS(ctx + “/common/fetchDictByDictType”,d,”json”);
              if(r==”noRight”){

                  return;
              }
              var defList = new Array();
              
              if(r.dictList!=null&&r.dictList!=’null’&&r.dictList!=”){

                  defList.push.apply(defList,r.dictList);
              }else{

                  defList.push({ “dictCode”:”0″, “dictName”: “暂无” });
              }
              var defvalue=””;
              if(re.program.playFlg!=null&&re.program.playFlg!=””){

                  defvalue=re.program.playFlg;
              }else{

                  defvalue=defList[0].dictCode;
              }
              $(“#playFlg”).combobox({

                  data:defList,
                  valueField:’dictCode’,
                  textField:’dictName’,
                  value:defvalue

              });

//onselect事件赋给id是name的文本框当前下拉框选中的文本值

 $(“#relationId”).combobox({

             onSelect:function(record){

                 $(‘#name’).val(record.name);   // name下拉框的显示的名称
             }
          });

//class属性是”easyui-textbox”,赋值用$(“#launcherName”).textbox(‘setValue’,’值’);

<input id=”launcherName” name=”launcherName” maxlength=”64″ class=”easyui-textbox” />

===================各位路过的美女帅哥,扫码领红包呦=========================

easyui combobox 赋值,取值,默认选中。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/230614.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号