<div title="統計明細" style="padding:5px;">
<table id="details"></table>
</div>
$('#count').datagrid({
url: '../ProductScrapAnalysis/GetGridSummaryData',
fit: true, //标题栏固定,但是需要设置上一级的 width hight
pagination: true, //顯示分頁功能
singleSelect: true, //單選
remoteSort: false, //设置列排序就将remoteSort设置为false
pageSize: 50, //还有属性可以设定size范围
rownumbers: true, //显示行号
striped: true, //隔行显示不同条纹
loadMsg: "正在拼命加載中。。。。",
//rowStyler: function(index,row){ //根據數據,設定行 的style
// if (row.SUMAHSTRIPQTY > 4 && row.SUMAHSTRIPQTY < 10) {
// return 'background-color:pink;color:blue;'; // return inline style
// // the function can return predefined css class and inline style
// // return {class:'r1', style:{'color:#fff'}};
// }
//},
//loadFilter:function(data)//過濾原始數據,不過需要返回含有total和rows的對象
//{
// console.log(data);
// var value = {
// total: 0,
// rows: []
// };
// data.rows.forEach(function (item) {
// if (Number(item.SUMAHPNLQTY) > 0 && Number(item.SUMAHPNLQTY) < 6) {
// value.rows.push(item);
// value.total++;
// }
// });
// return value;
//},
//loader: 通常和ajax一起用 ,url聽說會覆蓋datagrid 的URL屬性
columns: [[// halign 显示标题的位置 align 显示内容的位置 ,一般标题居中,文字靠左,数字靠右
{ field: 'FACTORYNAME', title: '廠別', width: 120, halign: 'center' },
{ field: 'AHSPECCODE', title: '工站代碼', width: 100, halign: 'center' },
{ field: 'SPECNAME', title: '工站名稱', width: 100, align: 'left', halign: 'center' },
{ field: 'SUMAHSTRIPQTY', title: '報廢條數匯總', width: 100, align: 'right', sortable: 'true' },
{ field: 'SUMQTY', title: '報廢PCS數匯總', width: 100, align: 'right', sortable: 'true' },
{
field: 'SUMAHPNLQTY', title: '報廢PNL數匯總', width: 100, align: 'right', sortable: 'true'
// ,styler: function (value, row, index) { // 根據單元格的數據,設定單元格的 style
// if (value < 10) {
// return 'background-color:#ffee00;color:red;';
// // the function can return predefined css class and inline style
// // return {class:'c1',style:'color:red'}
// }
//}
},
]],
ExportFileName: '生產報廢統計工站匯總', //自定义属性可以通过$(“#dg”).datagrid(""options"").ExportUrl 获得
onLoadSuccess: function (data) { $(this).datagrid('options').SqlCmdStr = data.SqlCmd; },// 加载成功时获得 URL、回传数据的属性
onRowContextMenu: function (e, index, row) { e.preventDefault(); $(this).datagrid('ShowGridMenu', e) }, //右鍵触发自定义事件
ExportUrl: '../ProductScrapAnalysis/ExportData'
});