|
楼主 |
发表于 2017-10-27 11:56:10
|
显示全部楼层
/**todo(自动创建labelEdit--input)
* @xidn xid的序号
* @parentnode 根节点dom
* @coloum 数据字段
* @mycalss 自定义input样式
* */
mycreate.create_labelEdit = function(parentnode,coloum,data,mycalss) {
var parentNode =parentnode;
if (parentNode) {
var xid = "labelEdit" +'diy'+this.xidn++;
var flag = {
xid : xid,
'class':'x-label-edit x-label40',
parentNode : parentNode
};
var labelEdit = new LabelEdit(flag);
var label = $('<label class="x-label hongxing" data-bind=textmodel.'+data+'.label(\"'+coloum+'\")></label>');
justep.Component.addNode(labelEdit.$domNode[0], label[0]);
var cfg = {
xid : "input" +'diy'+this.xidn++,
'class':'form-control x-edit '+mycalss,
'bind-ref' : ""+data+".ref('"+coloum+"')"
};
var input = new Input(cfg);
input.$domNode.attr('mycheck',coloum);
mycheck.init_0(data,input.$domNode);
justep.Component.addComponent(labelEdit.$domNode[0], input);
}
};
/**todo(自动创建labelEdit--select)
* @xidn xid的序号
* @parentnode 根节点dom
* @coloum 数据字段
* selectdata select数据
* */
mycreate.create_labelSelect = function(parentnode,coloum,data,selectdata) {
var parentNode =parentnode;
if (parentNode) {
var xid = "labelEdit" +'diy'+this.xidn++;
var flag = {
xid : xid,
'class':'x-label-edit x-label40',
parentNode : parentNode
};
var labelEdit = new LabelEdit(flag);
var label = $('<label class="x-label hongxing" data-bind=textmodel.'+data+'.label(\"'+coloum+'\")></label>');
justep.Component.addNode(labelEdit.$domNode[0], label[0]);
var cfg = {
parentNode : labelEdit.$domNode[0],
xid : "select" +'diy'+this.xidn++,
'class':'form-control x-edit',
'bind-ref' : ""+data+".ref('"+coloum+"')",
'bind-options':'window.getselect_Data("'+selectdata+'")',
'bind-optionsLabel':"name",
'bind-optionsValue':"name"
};
var select = new Select(cfg);
select.$domNode.attr('mycheck',coloum);
mycheck.init_0(data,select.$domNode);
}
}; |
|