fileupload、listselect、treeselect支持通过js.template指定readonly属性,或者通过cssClass指定disabled设置只读。
This commit is contained in:
@@ -244,7 +244,10 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
|
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
|
||||||
editable:true, edittype:'text', editoptions:{'class':'form-control laydate', 'readonly':'true',
|
editable:true, edittype:'text', editoptions:{'class':'form-control laydate', 'readonly':'true',
|
||||||
dataInit: function(element){
|
dataInit: function(element){
|
||||||
laydate.render({elem:element, type:'date', format:'yyyy-MM-dd'});
|
laydate.render({elem:element, type:'date', format:'yyyy-MM-dd', done: function(){
|
||||||
|
// 选择日期后,自动给下一个输入框赋值(联动实例)
|
||||||
|
// $(element).closest('td').next().find('.form-control').val('2020-11-26 10:10:10');
|
||||||
|
}});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -265,12 +268,16 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
id: 'user_'+editOptions.id, title: '用户选择',
|
id: 'user_'+editOptions.id, title: '用户选择',
|
||||||
name: 'testUser.userCode', value: val.split('|')[0],
|
name: 'testUser.userCode', value: val.split('|')[0],
|
||||||
labelName: 'testUser.userName', labelValue: val.split('|')[1],
|
labelName: 'testUser.userName', labelValue: val.split('|')[1],
|
||||||
url: '${ctx}/sys/office/treeData?isLoadUser=true', cssClass: ''
|
url: '${ctx}/sys/office/treeData?isLoadUser=true', cssClass: '', readonly: false
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
custom_value: function(element, act){
|
custom_value: function(element, act){
|
||||||
return {userCode: element.find('[type=hidden]').val(),
|
return {userCode: element.find('[type=hidden]').val(),
|
||||||
userName: element.find('[type=text]').val()};
|
userName: element.find('[type=text]').val()};
|
||||||
|
},
|
||||||
|
dataInit: function(element){
|
||||||
|
// 初始化控件后设置只读模式(实例)
|
||||||
|
// $(element).find('.form-control, .btn').addClass('disabled');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
unformat: function(val, obj, cell){
|
unformat: function(val, obj, cell){
|
||||||
@@ -286,7 +293,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
id: 'user_'+editOptions.id, title: '用户选择',
|
id: 'user_'+editOptions.id, title: '用户选择',
|
||||||
name: 'testUser2.userCode', value: val.split('|')[0],
|
name: 'testUser2.userCode', value: val.split('|')[0],
|
||||||
labelName: 'testUser2.userName', labelValue: val.split('|')[1],
|
labelName: 'testUser2.userName', labelValue: val.split('|')[1],
|
||||||
url: '${ctx}/sys/empUser/empUserSelect', cssClass: '',
|
url: '${ctx}/sys/empUser/empUserSelect', cssClass: '', readonly: false,
|
||||||
itemCode: 'userCode', itemName: 'userName'
|
itemCode: 'userCode', itemName: 'userName'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -301,7 +308,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
id: 'office_'+editOptions.id, title: '机构选择',
|
id: 'office_'+editOptions.id, title: '机构选择',
|
||||||
name: 'testOffice.officeCode', value: val.split('|')[0],
|
name: 'testOffice.officeCode', value: val.split('|')[0],
|
||||||
labelName: 'testOffice.officeName', labelValue: val.split('|')[1],
|
labelName: 'testOffice.officeName', labelValue: val.split('|')[1],
|
||||||
url: '${ctx}/sys/office/treeData?officeTypes=1,2', cssClass: ''
|
url: '${ctx}/sys/office/treeData?officeTypes=1,2', cssClass: '', readonly: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -315,7 +322,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
id: 'area_'+editOptions.id, title: '区域选择',
|
id: 'area_'+editOptions.id, title: '区域选择',
|
||||||
name: 'testAreaCode', value: val.split('|')[0],
|
name: 'testAreaCode', value: val.split('|')[0],
|
||||||
labelName: 'testAreaName', labelValue: val.split('|')[1],
|
labelName: 'testAreaName', labelValue: val.split('|')[1],
|
||||||
url: '${ctx}/sys/area/treeData', cssClass: ''
|
url: '${ctx}/sys/area/treeData', cssClass: '', readonly: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -325,7 +332,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
custom_element: function(val, editOptions) {
|
custom_element: function(val, editOptions) {
|
||||||
return js.template('fileuploadTpl', {
|
return js.template('fileuploadTpl', {
|
||||||
id: 'fileupload_'+editOptions.id, title: '区域选择',
|
id: 'fileupload_'+editOptions.id, title: '区域选择',
|
||||||
bizKey: val, bizType: 'testDataChild_file', cssClass: ''
|
bizKey: val, bizType: 'testDataChild_file', cssClass: '', readonly: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -365,17 +372,17 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
<script id="treeselectTpl" type="text/template">//<!--<div>
|
<script id="treeselectTpl" type="text/template">//<!--<div>
|
||||||
<#form:treeselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
|
<#form:treeselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
|
||||||
labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
|
labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
|
||||||
class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true"/>
|
class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true" readonly="{{d.readonly}}"/>
|
||||||
</div>//--></script>
|
</div>//--></script>
|
||||||
<script id="listselectTpl" type="text/template">//<!--<div>
|
<script id="listselectTpl" type="text/template">//<!--<div>
|
||||||
<#form:listselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
|
<#form:listselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
|
||||||
labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
|
labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
|
||||||
class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true"
|
class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true" readonly="{{d.readonly}}"
|
||||||
itemCode="{{d.itemCode}}" itemName="{{d.itemName}}"/>
|
itemCode="{{d.itemCode}}" itemName="{{d.itemName}}"/>
|
||||||
</div>//--></script>
|
</div>//--></script>
|
||||||
<script id="fileuploadTpl" type="text/template">//<!--<div>
|
<script id="fileuploadTpl" type="text/template">//<!--<div>
|
||||||
<#form:fileupload id="{{d.id}}" bizKey="{{d.bizKey}}" bizType="{{d.bizType}}"
|
<#form:fileupload id="{{d.id}}" bizKey="{{d.bizKey}}" bizType="{{d.bizType}}" uploadType="all"
|
||||||
uploadType="all" class="{{d.cssClass}}" isMini="true" preview="true"/>
|
class="{{d.cssClass}}" isMini="true" preview="true" readonly="{{d.readonly}}"/>
|
||||||
</div>//--></script>
|
</div>//--></script>
|
||||||
<script>
|
<script>
|
||||||
$("#inputForm").validate({
|
$("#inputForm").validate({
|
||||||
|
|||||||
Reference in New Issue
Block a user