datagrid 的标题的内容不对应整齐
生活随笔
收集整理的這篇文章主要介紹了
datagrid 的标题的内容不对应整齐
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
$(document).ready(function(){
var column = "[["+
"{'title':'工號','field':'grantorCode','sortable':'true','hidden':'true','width':fixWidth(0)},"+
"{'title':'外出告知人','field':'grantor','sortable':'true','width':fixWidth(0.15)},"+
"{'title':'開始時間','field':'startTime','sortable':'true','width':fixWidth(0.2),'formatter':function(value,row,index){return value.substring(0,19);}},"+
"{'title':'結束時間','field':'endTime','sortable':'true','width':fixWidth(0.2),'formatter':function(value,row,index){return value.substring(0,19);}},"+
"{'title':'狀態','field':'openClose','sortable':'true','width':fixWidth(0.15),'formatter':function(value,row,index){"+
" if (row.openClose=='1'){" +
" return '待確認';" +
" } else if(row.openClose=='2'){" +
" return '待生效';" +
" } else if(row.openClose=='3'){" +
" return '已生效';" +
" } else if(row.openClose=='4'){" +
" return '終止';" +
" } else if(row.openClose=='5'){" +
" return '取消';" +
" }" +
"}},"+
"{'title':'性質','field':'exp1','sortable':'true','width':fixWidth(0.15),'formatter':function(value,row,index){"+
" if (row.exp1=='sq'){" +
" return '授權';" +
" } else if(row.exp1=='qj'){" +
" return '外出告知';" +
" } else if(row.exp1=='zsq'){" +
" return '再授權';" +
" }" +
"}},"+
"{'title':'操作','field':'opt','sortable':'true','width':fixWidth(0.15),'formatter':function(value,row,index){"+
"var str='';"+
"var id=\"'\"+row.id+\"'\";"+
"var exp1=\"'\"+row.exp1+\"'\";"+
"if(row.exp2=='Y'){"+
"str += '<a class=\"ace_button\" href=\"#\" οnclick=\"stopOrdeleteOnlick('+id+','+exp1+')\">取消</a> ';" +
"}"+
"return str;"+
"}}"+
"]]";
column = eval(column);
$("#tEmDutyAuthorizztionList").datagrid({
columns:column,
rownumber:true,
fitcolumns:true,
idField:"id",
sortOrder:"desc",
sortName:"endTime",
fit:"true",
queryMode:"group"
}); });
//設置寬度百分比 function fixWidth(percent) {
return document.documentElement.clientWidth * percent; //這里你可以自己做調整
}
//設置高度百分比
function?fixHeight(percent)?{
return?document.documentElement.clientHeight?*?percent?-?9;?//這里你可以自己做調整
}
var column = "[["+
"{'title':'工號','field':'grantorCode','sortable':'true','hidden':'true','width':fixWidth(0)},"+
"{'title':'外出告知人','field':'grantor','sortable':'true','width':fixWidth(0.15)},"+
"{'title':'開始時間','field':'startTime','sortable':'true','width':fixWidth(0.2),'formatter':function(value,row,index){return value.substring(0,19);}},"+
"{'title':'結束時間','field':'endTime','sortable':'true','width':fixWidth(0.2),'formatter':function(value,row,index){return value.substring(0,19);}},"+
"{'title':'狀態','field':'openClose','sortable':'true','width':fixWidth(0.15),'formatter':function(value,row,index){"+
" if (row.openClose=='1'){" +
" return '待確認';" +
" } else if(row.openClose=='2'){" +
" return '待生效';" +
" } else if(row.openClose=='3'){" +
" return '已生效';" +
" } else if(row.openClose=='4'){" +
" return '終止';" +
" } else if(row.openClose=='5'){" +
" return '取消';" +
" }" +
"}},"+
"{'title':'性質','field':'exp1','sortable':'true','width':fixWidth(0.15),'formatter':function(value,row,index){"+
" if (row.exp1=='sq'){" +
" return '授權';" +
" } else if(row.exp1=='qj'){" +
" return '外出告知';" +
" } else if(row.exp1=='zsq'){" +
" return '再授權';" +
" }" +
"}},"+
"{'title':'操作','field':'opt','sortable':'true','width':fixWidth(0.15),'formatter':function(value,row,index){"+
"var str='';"+
"var id=\"'\"+row.id+\"'\";"+
"var exp1=\"'\"+row.exp1+\"'\";"+
"if(row.exp2=='Y'){"+
"str += '<a class=\"ace_button\" href=\"#\" οnclick=\"stopOrdeleteOnlick('+id+','+exp1+')\">取消</a> ';" +
"}"+
"return str;"+
"}}"+
"]]";
column = eval(column);
$("#tEmDutyAuthorizztionList").datagrid({
columns:column,
rownumber:true,
fitcolumns:true,
idField:"id",
sortOrder:"desc",
sortName:"endTime",
fit:"true",
queryMode:"group"
}); });
//設置寬度百分比 function fixWidth(percent) {
return document.documentElement.clientWidth * percent; //這里你可以自己做調整
}
//設置高度百分比
function?fixHeight(percent)?{
return?document.documentElement.clientHeight?*?percent?-?9;?//這里你可以自己做調整
}
轉載于:https://www.cnblogs.com/xlj227/p/10855020.html
總結
以上是生活随笔為你收集整理的datagrid 的标题的内容不对应整齐的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 光大银行信用卡还款日是什么时候?怎么查询
- 下一篇: 《算法竞赛进阶指南》0.5排序