1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| $('#tt').datagrid({ url: '/UserInfo/GetAllUserInfos', title: '演示表格使用', width: 700, height: 400, fitColumns: true, idField: 'ID', loadMsg: '正在加载用户的信息...', pagination: true, singleSelect: false, pageSize:10, pageNumber:1, pageList: [10, 20, 30], queryParams: {}, columns: [[ { field: 'ck', checkbox: true, align: 'left', width: 50 }, { field: 'ID', title: '主键', width: 80 }, { field: 'UserName', title: '用户名', width: 120 }, { field: 'SubTime', title: '提交时间', width: 80, align: 'right', formatter:function(value,row,index){ return (eval(value.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"))).pattern("yyyy-M-d h:m:s.S"); } }, {field:'showprice',title:'商品价格',width:80,align:'right', styler:function(value,row,index){ if (value < 20){ return 'background-color:#ffee00;color:red;'; } }, formatter:function(value,row,index){ return "<a href='#' onclick='editGoodsPrice("+row.goodsid+");return false;'>"+value+"</a>"; } } ]], toolbar: [{ id: 'btnDownShelf', text: '上架', iconCls: 'icon-add', handler: function () { var rows = $('#goodGrid').datagrid('getSelections'); if (!rows || rows.length == 0) { $.messager.alert("选择商品提醒", "请选择要修改的商品!", "error"); return; } $.messager.confirm("上架提醒", "您是否要真的要将此商品上架?", function (r) { if (r) { updateGoodsNewHot(rows, "onshelf"); } }); } }], onHeaderContextMenu: function (e, field) {
} });
|