标签:
A、{field:‘station_staus‘,title:‘工位状态‘,width:250,align:‘center‘,formatter: function(value,row,index){ if (row.station_staus==0){ return "现实"; } if(row.station_staus==1){ return "虚拟"; } }}, B、function(value, row, index) { return "<a href=‘javascript:void(0)‘ onclick=‘edit(\""+row.id+"\")‘>修改</a> <a href=‘javascript:void(0)‘ onclick=‘del(\""+row.id+"\")‘>删除</a>";} C、可以直接编辑 {field:‘22‘,title:‘操作‘,width:230,align:‘center‘,sortable:true,formatter : function(value, row, index) { return "<a href=‘javascript:void(0)‘ onclick=‘edit(\""+row.id+"\")‘>修改</a> <a href=‘javascript:void(0)‘ onclick=‘del(\""+row.id+"\")‘>删除</a>"; }} ] ], border : false, striped : true, fit : true, rownumbers : true, pageSize : 20, fitColumns : true, ctrlSelect : true, pagination : true, remoteSort : false, toolbar : "#tool", onAfterEdit: function (rowIndex, rowData, changes) { //endEdit该方法触发此事件 console.info(rowData); saveSort(rowData.id,rowData.sort); editRow = undefined; }, onDblClickCell: function (rowIndex, rowData) { //双击开启编辑行 if (editRow != undefined) { $("#tb").datagrid("endEdit", editRow); editRow = undefined; } if (editRow == undefined) { $("#tb").datagrid("beginEdit", rowIndex); editRow = rowIndex; } } , onClickRow:function(rowIndex,rowData){ if (editRow != undefined) { $("#tb").datagrid("endEdit", editRow); } } }); }); } D、 列表栏区域变色 {field:‘state‘,title:‘状态‘,width:100,align:‘center‘,sortable:true,formatter : function(value, row, index) { if (row.state == "1") { return "<span style=‘color:red‘>已回访</span>"; }else{ return "<span style=‘color:green‘>未回访</span>"; } }},
标签:
原文地址:http://www.cnblogs.com/baijin05/p/5040363.html