easyUI下拉框及触发事件

自定义下拉框,使用data,将数据列表加载

                            <input type="text" class="easyui-combobox" style="width:125px" name="materialname" id="materialname" 

                                    data-options="valueField:'id',
                                            textField:'text',
                                            data:
                                        [{ 'id':'FPCID',    
                                            'text':'FPC解绑' ,
                                            selected:true  
                                        },{    
                                            'id':'BLUID',    
                                            'text':'背光解绑'                              
                                        },{    
                                            'id':'CGID',    
                                            'text':'盖板解绑'     
                                        },{    
                                            'id':'MODULEID',    
                                            'text':'喷码解绑'     
                                        }] ,panelHeight:'auto' 
                            "/>

选中触发事件:
onSelect 等同于 onChange

     $(function(){
        $("#materialname").combobox({
            onSelect:function(record){
                $('#materialid').focus();

        }       
    })
    })

                                <input  class="easyui-combobox" id="downgrade" name="downgrade" style="width:155px;height:20px;margin:1px;padding:0px;"
                                             data-options="valueField:'id',
                                            textField:'text',
                                            data:
                                        [{ 'id':'LCD',    
                                            'text':'LCD降级大箱打包' ,
                                            selected:true  
                                        },{    
                                            'id':'FOG',    
                                            'text':'FOG降级大箱打包'                              
                                        },{    
                                            'id':'LCM',    
                                            'text':'LCM降级大箱打包'     
                                        }] ,panelHeight:'auto' ,onSelect:function(){getweight();}
                            "
                                />
  function getweight(){         
                var weight = $('#downgrade').combobox('getValue') + 'weight';
                $.post('fgcodeManageAction!doPanelQty.action', {
                                subattributename : weight,
                                operationcode:'M092'
                            }, function(data) {
                                if(data.message=='AREABASE_INDO_FAIL'){
                                    setMssage(data.messageCode);
                                     focusp();
                                }else{

                                    $("#weight").val(data.vae);
                                    $("#plannedqty").val(data.panelqty);
                                     focusp();
                                }
                        });  
   }
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Easyui框的使用是通过在input标签上添加class为"easyui-combobox"的属性来实现的。在引用中的前端代码中可以看到示例的input标签如下所示: ``` <input type="text" id="city_name" name="city_name" class="easyui-combobox" data-options="editable:true ,valueField: 'id',textField: 'text',url:'${pageContext.request.contextPath}/admin/main/getcity',prompt: '城市名称',validType:'length中的代码示例中,通过onSelect事件获取到选中的城市,并使用Ajax向服务端发送请求,获取该城市下的其他数据,并将数据展示在页面中的相应元素中。 综上所述,Easyui框的使用是通过在input标签上添加class为"easyui-combobox"的属性,并通过data-options属性设置组件的配置选项来实现。在JavaScript代码中可以监听onSelect事件获取选择的值,并进行相应的操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Jquery Easyui自定义下框组件使用详解(21)](https://download.csdn.net/download/weixin_38506713/14805938)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [easyui框选中触发事件](https://blog.csdn.net/qq_36746327/article/details/80111119)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值