关于给gridSelect控件设置默认值

给这个选择表格框添加默认值;

关于给gridSelect控件设置默认值

<td class="form_label">
                            客户名称:
                        </td>
                        <td colspan="1">
                            <input class="nui-buttonedit" id="contract.customerName" maxLength="50"  style="width:125px;min-height:22;"  onbuttonclick="selectCustomer"/>
                             <!-- <input class="nui-textbox"  id="contract.contractSignCompany" name="contract.contractSignCompany"/> -->
                             <input class="nui-hidden" inputStyle="text-align:right;" name="contract.customerId"/>
                             <input class="nui-hidden" inputStyle="text-align:right;" name="contract.contractSignCompany"/>
                          
                        </td>

找到这个控件   在控件里添加id这个属性

然后到js里找到setdata这个方法

function setData(data){
                data = nui.clone(data);
               //nui.get("grid_0").load({contract:data});
                var json = nui.encode({contract:data});
                $.ajax({
                    url:"com.ezsoft.contract.contractbiz.getContract.biz.ext",
                    type:'POST',
                    data:json,
                    cache:false,
                    contentType:'text/json',
                    success:function(text){
                        obj = nui.decode(text);
                        form.setData(obj);
                          debugger;
                          nui.get("contract.customerName").setText(obj.contract.customerName);
                       
                       
                        form.setChanged(false);
                    }
                    });
                }

使用nui.get("contract.customerName").setText(obj.contract.customerName);   找到这个id的选择框,同时给这个选择框赋值

上一篇:【RabbitMQ】 Routing


下一篇:关于json格式字符串解析并用mybatis存入数据库