update demo
This commit is contained in:
@@ -133,7 +133,7 @@ $('#dataGrid').dataGrid({
|
||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}, unformat: function(val, obj, cell){return $('#'+obj.rowId+'_'+obj.colModel.name, cell).val();}
|
||||
},
|
||||
@@ -141,7 +141,7 @@ $('#dataGrid').dataGrid({
|
||||
// editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||
// items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
// itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
// $(element).select2().on("change",function(){$(this).resetValid()});
|
||||
// js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
// }
|
||||
// }, unformat: function(val, obj, cell){return $('#'+obj.rowId+'_'+obj.colModel.name, cell).val();}
|
||||
// },
|
||||
|
||||
@@ -14,105 +14,105 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<#form:form id="searchForm" model="${testData}" action="${ctx}/test/testData/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">单行文本:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="testInput" maxlength="200" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">多行文本:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="testTextarea" maxlength="200" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">下拉框:</label>
|
||||
<div class="control-inline width-120">
|
||||
<#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">下拉多选:</label>
|
||||
<div class="control-inline width-120">
|
||||
<#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">单选框:</label>
|
||||
<div class="control-inline">
|
||||
<#form:radio path="testRadio" dictType="sys_menu_type" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">复选框:</label>
|
||||
<div class="control-inline">
|
||||
<#form:checkbox path="testCheckbox" dictType="sys_menu_type" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">日期选择:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="testDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
|
||||
dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="testDate_lte.click()"/>
|
||||
-
|
||||
<#form:input path="testDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
|
||||
dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">日期时间:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="testDatetime_gte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
|
||||
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm" data-done="testDatetime_lte.click()"/>
|
||||
-
|
||||
<#form:input path="testDatetime_lte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
|
||||
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">用户选择:</label>
|
||||
<div class="control-inline width-120" >
|
||||
<#form:treeselect id="testUser" title="用户选择"
|
||||
path="testUser.userCode" labelPath="testUser.userName"
|
||||
url="${ctx}/sys/office/treeData?isLoadUser=true" allowClear="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">机构选择:</label>
|
||||
<div class="control-inline width-120" >
|
||||
<#form:treeselect id="testOffice" title="机构选择"
|
||||
path="testOffice.officeCode" labelPath="testOffice.officeName"
|
||||
url="${ctx}/sys/office/treeData" allowClear="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">区域选择:</label>
|
||||
<div class="control-inline width-120" >
|
||||
<#form:treeselect id="testAreaCode" title="区域选择"
|
||||
path="testAreaCode" labelPath="testAreaName"
|
||||
url="${ctx}/sys/area/treeData" allowClear="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">状态:</label>
|
||||
<div class="control-inline width-120">
|
||||
<#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control isQuick"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">备注信息:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="remarks" maxlength="500" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">查询</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">重置</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<#form:form id="searchForm" model="${testData}" action="${ctx}/test/testData/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">单行文本:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="testInput" maxlength="200" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">多行文本:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="testTextarea" maxlength="200" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">下拉框:</label>
|
||||
<div class="control-inline width-120">
|
||||
<#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">下拉多选:</label>
|
||||
<div class="control-inline width-120">
|
||||
<#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">单选框:</label>
|
||||
<div class="control-inline">
|
||||
<#form:radio path="testRadio" dictType="sys_menu_type" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">复选框:</label>
|
||||
<div class="control-inline">
|
||||
<#form:checkbox path="testCheckbox" dictType="sys_menu_type" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">日期选择:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="testDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
|
||||
dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="testDate_lte.click()"/>
|
||||
-
|
||||
<#form:input path="testDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
|
||||
dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">日期时间:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="testDatetime_gte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
|
||||
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm" data-done="testDatetime_lte.click()"/>
|
||||
-
|
||||
<#form:input path="testDatetime_lte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
|
||||
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">用户选择:</label>
|
||||
<div class="control-inline width-120" >
|
||||
<#form:treeselect id="testUser" title="用户选择"
|
||||
path="testUser.userCode" labelPath="testUser.userName"
|
||||
url="${ctx}/sys/office/treeData?isLoadUser=true" allowClear="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">机构选择:</label>
|
||||
<div class="control-inline width-120" >
|
||||
<#form:treeselect id="testOffice" title="机构选择"
|
||||
path="testOffice.officeCode" labelPath="testOffice.officeName"
|
||||
url="${ctx}/sys/office/treeData" allowClear="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">区域选择:</label>
|
||||
<div class="control-inline width-120" >
|
||||
<#form:treeselect id="testAreaCode" title="区域选择"
|
||||
path="testAreaCode" labelPath="testAreaName"
|
||||
url="${ctx}/sys/area/treeData" allowClear="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">状态:</label>
|
||||
<div class="control-inline width-120">
|
||||
<#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control isQuick"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">备注信息:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="remarks" maxlength="500" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">查询</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">重置</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
<div id="dataGridPage"></div>
|
||||
</div>
|
||||
|
||||
@@ -333,7 +333,7 @@ $("#testDataChildDataGrid").dataGrid({
|
||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -341,7 +341,7 @@ $("#testDataChildDataGrid").dataGrid({
|
||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -349,7 +349,7 @@ $("#testDataChildDataGrid").dataGrid({
|
||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -357,7 +357,7 @@ $("#testDataChildDataGrid").dataGrid({
|
||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -163,7 +163,7 @@ $("#testDataChildDataGrid").dataGrid({
|
||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
<div class="form-unit">${text('基本信息')}</div>
|
||||
<#form:hidden path="id"/>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<label class="control-label col-sm-2" title="">
|
||||
<span class="required hide">*</span> ${text('单行文本')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<div class="col-sm-10">
|
||||
<#form:input path="testInput" maxlength="200" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -202,73 +202,100 @@ $("#testDataChildDataGrid").dataGrid({
|
||||
|
||||
// 设置数据表格列
|
||||
columnModel: [
|
||||
|
||||
{header:'${text("操作")}', name:'actions', width:40, align:"center", formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
if (val == 'new'){
|
||||
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
}else{
|
||||
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'setRowData\',\''+obj.rowId+'\',null,{display:\'none\'});$(\'#'+obj.rowId+'_status\').val(\''+Global.STATUS_DELETE+'\');});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
}
|
||||
return actions.join('');
|
||||
}, editoptions: {defaultValue: 'new'}},
|
||||
|
||||
{header:'状态', name:'status', editable:true, hidden:true},
|
||||
{header:'主键', name:'id', editable:true, hidden:true},
|
||||
{header:'${text("排序号")}', name:'testSort', width:130, editable:true, edittype:'text', editoptions:{'maxlength':'11', 'class':'form-control digits'}},
|
||||
{header:'${text("排序号")}', name:'testSort', width:100, editable:true, edittype:'text', editoptions:{'maxlength':'11', 'class':'form-control digits'}},
|
||||
{header:'${text("父表主键")}', name:'testData.id', editable:true, hidden:true},
|
||||
{header:'${text("单行文本")}', name:'testInput', width:130, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
|
||||
{header:'${text("多行文本")}', name:'testTextarea', width:130, editable:true, edittype:'textarea', editoptions:{'maxlength':'200', 'class':'form-control', 'rows':'1'}},
|
||||
{header:'${text("单行文本")}', name:'testInput', width:100, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
|
||||
{header:'${text("多行文本")}', name:'testTextarea', width:100, editable:true, edittype:'textarea', editoptions:{'maxlength':'200', 'class':'form-control', 'rows':'1'}},
|
||||
{header:'${text("下拉框")}', name:'testSelect', width:100,
|
||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("下拉多选")}', name:'testSelectMultiple', width:130,
|
||||
{header:'${text("下拉多选")}', name:'testSelectMultiple', width:90, fixed: true,
|
||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("单选框")}', name:'testRadio', width:100,
|
||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
{header:'${text("单选框")}', name:'testRadio', width:135, fixed: true,
|
||||
editable:true, edittype:'radio', editoptions:{'class':'form-control icheck',
|
||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
js.iCheck(element).on("ifChanged",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("日期选择")}', name:'testDate', width:150,
|
||||
{header:'${text("复选框")}', name:'testCheckbox', width:135, fixed: true,
|
||||
editable:true, edittype:'checkbox', editoptions:{'class':'form-control icheck',
|
||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
js.iCheck(element).on("ifChanged",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("日期选择")}', name:'testDate', width:120,
|
||||
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',
|
||||
dataInit: function(element){
|
||||
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');
|
||||
// $(element).closest('td').next().find('.form-control').val('2020-11-26 10:10');
|
||||
}});
|
||||
}
|
||||
}
|
||||
},
|
||||
// {header:'${text("用户选择")}', name:'testUser', width:150,
|
||||
// formatter: function(val, obj, row, act){
|
||||
// return js.val(row, 'testUser.userCode')+'|'+js.val(row, 'testUser.userName');
|
||||
// }, editable: true, edittype: "custom", editoptions: {
|
||||
// custom_element: function(val, editOptions) {
|
||||
// return js.template('treeselectTpl', {
|
||||
// id: 'user_'+editOptions.id, title: '用户选择',
|
||||
// name: 'testUser.userCode', value: val.split('|')[0],
|
||||
// labelName: 'testUser.userName', labelValue: val.split('|')[1],
|
||||
// url: '${ctx}/sys/office/treeData?isLoadUser=true', cssClass: '', readonly: false
|
||||
// });
|
||||
// },
|
||||
// custom_value: function(element, act){
|
||||
// return {userCode: element.find('[type=hidden]').val(),
|
||||
// userName: element.find('[type=text]').val()};
|
||||
// },
|
||||
// dataInit: function(element){
|
||||
// // 初始化控件后设置只读模式(实例)
|
||||
// // $(element).find('.form-control, .btn').addClass('disabled');
|
||||
// }
|
||||
// },
|
||||
// unformat: function(val, obj, cell){
|
||||
// return $('#user_'+obj.rowId+'_'+obj.colModel.name+'Code', cell).val();
|
||||
// }
|
||||
// },
|
||||
{header:'${text("用户选择")}', name:'testUser2', width:150,
|
||||
{header:'${text("日期时间")}', name:'testDatetime', width:155,
|
||||
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i'},
|
||||
editable:true, edittype:'text', editoptions:{'class':'form-control laydate', 'readonly':'true',
|
||||
dataInit: function(element){
|
||||
laydate.render({elem:element, type:'datetime', format:'yyyy-MM-dd HH:mm'});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("用户选择")}', name:'testUser', width:100,
|
||||
formatter: function(val, obj, row, act){
|
||||
return js.val(row, 'testUser.userCode')+'|'+js.val(row, 'testUser.userName');
|
||||
}, editable: true, edittype: "custom", editoptions: {
|
||||
custom_element: function(val, editOptions) {
|
||||
return js.template('treeselectTpl', {
|
||||
id: 'user_'+editOptions.id, title: '用户选择',
|
||||
name: 'testUser.userCode', value: val.split('|')[0],
|
||||
labelName: 'testUser.userName', labelValue: val.split('|')[1],
|
||||
url: '${ctx}/sys/office/treeData?isLoadUser=true', cssClass: '', readonly: false
|
||||
});
|
||||
},
|
||||
custom_value: function(element, act){
|
||||
return {userCode: element.find('[type=hidden]').val(),
|
||||
userName: element.find('[type=text]').val()};
|
||||
},
|
||||
dataInit: function(element){
|
||||
// 初始化控件后设置只读模式(实例)
|
||||
// $(element).find('.form-control, .btn').addClass('disabled');
|
||||
}
|
||||
},
|
||||
unformat: function(val, obj, cell){
|
||||
return $('#user_'+obj.rowId+'_'+obj.colModel.name+'Code', cell).val();
|
||||
}
|
||||
},
|
||||
{header:'${text("用户选择")}', name:'testUser2', width:100,
|
||||
formatter: function(val, obj, row, act){
|
||||
return js.val(row, 'testUser.userCode')+'|'+js.val(row, 'testUser.userName');
|
||||
}, editable: true, edittype: "custom", editoptions: {
|
||||
@@ -283,7 +310,7 @@ $("#testDataChildDataGrid").dataGrid({
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("机构选择")}', name:'testOffice', width:150, title:false,
|
||||
{header:'${text("机构选择")}', name:'testOffice', width:100, title:false,
|
||||
formatter: function(val, obj, row, act){
|
||||
return js.val(row, 'testOffice.officeCode')+'|'+js.val(row, 'testOffice.officeName');
|
||||
}, editable: true, edittype: "custom", editoptions: {
|
||||
@@ -297,7 +324,7 @@ $("#testDataChildDataGrid").dataGrid({
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("区域选择")}', name:'testAreaCode', width:150,
|
||||
{header:'${text("区域选择")}', name:'testAreaCode', width:100,
|
||||
formatter: function(val, obj, row, act){
|
||||
return js.val(row, 'testAreaCode')+'|'+js.val(row, 'testAreaName');
|
||||
}, editable: true, edittype: "custom", editoptions: {
|
||||
@@ -320,17 +347,9 @@ $("#testDataChildDataGrid").dataGrid({
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("操作")}', name:'actions', width:60, sortable:false, fixed:true, formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
if (val == 'new'){
|
||||
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
}else{
|
||||
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'setRowData\',\''+obj.rowId+'\',null,{display:\'none\'});$(\'#'+obj.rowId+'_status\').val(\''+Global.STATUS_DELETE+'\');});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
}
|
||||
return actions.join('');
|
||||
}, editoptions: {defaultValue: 'new'}}
|
||||
}
|
||||
],
|
||||
shrinkToFit: false, // 是否按百分比自动调整列宽
|
||||
|
||||
// 编辑表格参数
|
||||
editGrid: true, // 是否是编辑表格
|
||||
|
||||
Reference in New Issue
Block a user