DataGrid (data table) component [3]

Source: Internet
Author: User

This lesson focuses on how the DataGrid (data table) component is used in Easyui, which relies on
Panel, resizeable (resizing), LinkButton (button), pageination (pagination) components.

A Style settings

Style settings
$ (' #box '). DataGrid ({
URL: ' user.php ',
Title: ' User List ',
WIDTH:500,
Iconcls: ' Icon-search ',
Striped:true,
Nowrap:true,
Fitcolumns:true,
Columns: [[
{
Field: ' User ',
Title: ' Account Number ',
Sortable:true,
Align: ' center ',
HAlign: ' Center ',
Resizable:false,
Hidden:false,
Formatter:function (Value,row,index) {
Return ' [' + value + '] ';
},
Styler:function (Value,row,index) {
if (value = = ' Li Tinghui ') {
Return ' Background-color:orange ';
}
},
},
{
Field: ' Email ',
Title: ' Mail ',
Sortable:true,
Sorter:function (A, b) {
Console.log (A + ' | ' + b);
},
},
{
Field: ' Date ',
Title: ' Registration Time ',

Sortable:true,
},
]],
Data: [
{
User: ' Crayon little New ',
Email: ' [email protected] ',
Date: ' 2014-10-1 ',
},
],
Loadmsg: ' Trying to unfold ... ',
Rownumbers:true,
Singleselect:true,
Pagination:true,
IDfield: ' id ',
Pagesize:10,
PageList: [10, 20, 30, 40],
Pagenumber:1,
Sortname: ' Date ',
SortOrder: ' DESC ',
Showheader:true,
Showfooter:true,
SCROLLBARSIZE:20,
Rowstyler:function (index, row) {
if (Row.user = = ' Lord of the Rings ') {
You can also return a CSS class name directly.
Return ' Background-color:orange ';
}
},
});

DataGrid (data table) component [3]

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.