Easyui----Grid

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.