1.jsp页面中:
<nav class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="view grid-wrapper">
<div class="view-header">
<a class="active">试卷管理</a>
<nav class="datagrid-tool right">
<span class="module">
<a class="btn btna b-white plan">
<i class="ico jl1-icon"></i>
<span>题目</span>
</a>
</span>
</nav>
</div>
<div class="grid-primary">
<div id="manageList" class="grid-resize">
</div>
</div>
</nav>
2.JS内的初始化:
$(funtion(){
$("#manageList").datagrid({
url:path+"",//获取数据路径
func:[{
title:"查看",//此处也可写function方法判断
call:caOK,//可写function方法判断
disabled:function(date){
var yy = date.dayy;
if(yy=1){
return true;//返回true则方法不可用
}else{
return false;
}
}
},{
title:"",
call:fangfa,
disabled:functionfangfa
}],
columns:[[
{field:'good'},
{field:'OK'},
{field:'hello'}
]],
});
});
function initViewDef(){
$("#manageList").viewdef({
gridid:"#manageList",
ext:{
moduletype:"OKGood"
direction:"column"
},
columns:[{
field:'good',align:'center',sortable:true,title:"文字描述",fieldtype:"类型如date",formatter:方法function
},{
field:'OK',align:'center',sortable:true,title:"文字描述",fieldtype:"类型如date",formatter:方法function
},{
field:'hello',align:'center',sortable:true,title:"文字描述",fieldtype:"类型如date",formatter:方法function
}]
});
};