js动态添加input标签 easyui combox
这样写为什么没效果?varinput=$("<input/>").appendTo(td8);input.attr("class","easyui-combobox");...
这样写为什么没效果?
var input = $("<input/>").appendTo(td8);
input.attr("class","easyui-combobox");
input.attr("name","fgszc2Flow"+size+".FYMC");
input.attr("style","width:180px;");
input.attr("data-options","url: '${ctx }/fgszc/flow2/getSelectFymc',method:'get', valueField:'code',textField:'name', groupField:'pname'");
换了一直写法,发现成功了!
input.attr("class","easyui-combobox");
input.attr("name","fgszc2Flow"+size+".FYMC");
input.attr("id","combox"+size);
input.attr("style","width:180px;");
$("#combox"+size).combobox({
url:'${ctx }/fgszc/flow2/getSelectFymc',
method:'get',
valueField:'code',
textField:'name',
groupField:'pname'
});
不知道为啥 ,某些机制?? 展开
var input = $("<input/>").appendTo(td8);
input.attr("class","easyui-combobox");
input.attr("name","fgszc2Flow"+size+".FYMC");
input.attr("style","width:180px;");
input.attr("data-options","url: '${ctx }/fgszc/flow2/getSelectFymc',method:'get', valueField:'code',textField:'name', groupField:'pname'");
换了一直写法,发现成功了!
input.attr("class","easyui-combobox");
input.attr("name","fgszc2Flow"+size+".FYMC");
input.attr("id","combox"+size);
input.attr("style","width:180px;");
$("#combox"+size).combobox({
url:'${ctx }/fgszc/flow2/getSelectFymc',
method:'get',
valueField:'code',
textField:'name',
groupField:'pname'
});
不知道为啥 ,某些机制?? 展开
1个回答
2016-10-26 · 知道合伙人软件行家
关注
展开全部
方法一:
1 var data, json;
2 json = '[{"id":"年计划","text":"年计划","selected":true}]';
3 data = $.parseJSON(json);
4 $("#rwlb").combobox("loadData", data);
方法二:
1 var data,json;
2 data = [];
3 data.push({ "text": "测试", "id": 100 });
4 $("#rwlb").combobox("loadData", data);
1 var data, json;
2 json = '[{"id":"年计划","text":"年计划","selected":true}]';
3 data = $.parseJSON(json);
4 $("#rwlb").combobox("loadData", data);
方法二:
1 var data,json;
2 data = [];
3 data.push({ "text": "测试", "id": 100 });
4 $("#rwlb").combobox("loadData", data);
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询