Jquery esay ui datagrid formatter属性简单使用

来源:互联网 发布:数值是优化算法与理论 编辑:程序博客网 时间:2024/06/06 12:35

//初始化数据

function initDataGrid({

url:'/test/test_findTestTypeByParametes.action',

  columns: [[
{field:'testId', checkbox:true },

{field:'testName', title:'测试名称', width:200, formatter:formatTestState},

{field:'testState', title:'状态', width:200}

  ]]

});

function formatTestState(value, rowData, rowIndex){

//value 传入的值

//rowData根据下标拿值

if(rowData['testState']==1){

//返回
return value+"(以删除)";
}else{
return value;
}
}