<table id="ordersTemplateGrid"
style="height: 100%;width: 100%"
data-options="border:false,
noheader:'false',
fit:true,
singleSelect:true,
selectOnCheck:false,
checkOnSelect:false,
remoteFilter: false,
nowrap:true,
fitColumns:true,
checkbox:true,
toolbar:'#ordersTempateToolbar'
">
<thead>
<tr>
<th data-options="field:'ck',width:40,checkbox:true"></th>
<th data-options="field:'ordserCode',width:40">医嘱类型</th>
<th data-options="field:'ordserName',width:100">医嘱名称</th>
<th data-options="field:'wbm',width:40">五笔码</th>
<th data-options="field:'pym',width:40,hidden:true">拼音码</th>
<th data-options="field:'status',width:40,formatter:ordersTemplate.formatStatus">是否禁用</th>
</tr>
</thead>
</table>
js代码:
var ordersTemplate = {
loadGrid:function(){
},
initGrid:function(){
if($$('#ordersTemplateGrid').attr('init') != 'true'){
if(console){
console.log('初始化表格');
}
$$('#ordersTemplateGrid').datagrid({
url:'${ctx}/orders/templateOrders.do',
queryParams:{
},
onSelect:ordersTemplate.onSelect
});
$$('#ordersTemplateGrid').attr('init','true');
$$('#ordersTemplateGrid').datagrid('enableFilter', []);
$$('#ordersTemplateItemGrid').datagrid({
url:'orders/templateOrderLists.do',
queryParams:{
'ordserCode':''
},
onClickCell:function(index, field){
$(this).datagrid("onClickCell",{index:index,field:field});
var row = $(this).datagrid("getSelected");
if(row){
//if(row.)
}
},
onLoadSuccess:function(){
//ordersTemplate.append();
},
onEndEdit: ordersTemplate.onEndEdit
});
}
},
formatStatus:function(val,row,index){
if(!val || val == 2){
return "启用";
}else{
return "禁用";
}
}
}