$ (' #dg '). DataGrid ({ columns:[[ {field: ' Time ', title: ' Title 1,width:140}, {field: ' Sum_num ', title: ' Title 2,width:140, Styler:function (Value,row,index) { if (value < 20) { Return ' Background-color: #ffee00; color:red;text-decoration:underline; '; } }}, {field: ' Province_num ', title: ' Title 3,width:140,align: ' Right '}, {field: ' Group_num ', title: ' Title 4 ', width:140, Styler:function (Value,row,index) { if (value < 20) { Returns the style defined inside the CSS return {class: ' C1 ', Style: ' color:red '} } }} ]] , Height:360, Pagesize:10, Showheader:true,//Whether the head is displayed Rownumbers:true,//whether the number of rows is displayed Pagination:true,//whether to display the paging component Rowstyler:function (Index,row) { if (row. SUM_NUM>80) { Return ' Background-color: #6293BB; color: #fff; '; } }, Onclickcell:function (Index,field,value) { /* Index: Row indexes, 0 start Field: Field name of the selected column binding Value: The contents of the cell display */ } }); |