1. Set header row Height
. Datagrid-header-row Td{background-color:rgb (15,185,234); color: #fff; height:35px; font-size:14pt;font-family: " Microsoft Yahei ", Verdana,simsun," Segoe UI Web Light "," Segoe UI Light "," Segoe UI Web Regular "," Segoe UI "," Segoe UI Symbol ", "Helvetica Neue", Arial}
2. Set the content row height
. datagrid-row {height:32px;}
3. Same Walk and checkbox click events
function Initgrid (taskTypeID) {
$ ("#bt_buttion1"). attr ("Class", "tlbtn2 btndisabled");
$ ("#bt_buttion2"). attr ("Class", "tlbtn2 btndisabled");
$ (' #assctlgDiv '). empty ();
$ (' #assctlgDiv '). DataGrid ({
URL: "/.. /griddata.do?tasktypeid= "+tasktypeid,
Fitcolumns:true,
Fit:true,
Checkbox:true,
Rownumbers:true,
Columns: [[
{
Field: ",
Title: ' Single Choice ',
Align: ' center ',
Checkbox:true
},
{
Field: ' Bgtstage ',
Title: ' AAA ',
HAlign: ' Center ',
Align: ' left ',
Width: ' 24% ',
Formatter:function (value, record, index) {
if (value = = 0) {
Return ' <span style=color:red; >A</span> ';
} else if (value = = 1) {
Return ' <span Style=color:green; >B</span> ';
} else if (value = = 2) {
Return ' <span style=color:blue; >C</span> ';
}
}
}, {
Field: ' Confirmtime ',
Title: ' BBBB ',
HAlign: ' Center ',
Align: ' left ',
Width: ' 24% ',
Formatter:function (value, record, index) {
if (value = = "") {
Return ' <span>AAA</span> ';
}else{
return value;
}
}
}]],
Onselect:function ()//Select a row
{
Toolblock ();
},
Onunselect:function ()
{
Toolblock ();
},
Onselectall:function ()
{
Toolblock ();
},
Onunselectall:function ()
{
$ ("#bt_buttion1"). attr ("Class", "tlbtn2 btndisabled");
$ ("#bt_buttion2"). attr ("Class", "tlbtn2 btndisabled");
}
});
};
function Toolblock () {
var rows = $ (' #assctlgDiv '). DataGrid (' Getselections ');
var count = 0;
var count1 = 0;
$.each (rows, function (index, row) {
if (row.bgtstage== "0") {
count=count+1;
};
if (row.bgtstage== "1") {
count1=count1+1;
};
});
if (rows.length==count&&count>0) {
$ ("#bt_buttion1"). attr ("Class", "tlbtn2");
}else if (rows.length==count1&&count1>0) {
$ ("#bt_buttion2"). attr ("Class", "tlbtn2");
}else{
$ ("#bt_buttion1"). attr ("Class", "tlbtn2 btndisabled");
$ ("#bt_buttion2"). attr ("Class", "tlbtn2 btndisabled");
}
}
Easyui----Grid