动态创建select需要在V3.6以及之后的版本才可以用,V3.6之前的版本有缺陷不支持
在动态创建时要注意
1. bind-ref:直接用data的xid,不要用this.comp(‘data的xid’);
2. bind-options:直接用data的xid.datas
3. bind-optionsLabel和bind-optionsValue:直接设置bind-options关联data中的关系名
参考如下:
引用js文件var select = require(“$UI/system/components/justep/select/select”);
动态创建
var parentNode = this.getElementByXid("content2");
var options = {
parentNode : parentNode,
xid : 'select1',
class : "form-control x-edit",
'bind-ref' : "data2.ref('fName')",
'bind-options' : "data1.datas",
'bind-optionsLabel' : "fName",
'bind-optionsValue' : "fValue"
};
new select(options);
评一波