EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: pacific202 on November 16, 2011, 10:23:09 PM



Title: Please explain the nested arrays in datagrid columns
Post by: pacific202 on November 16, 2011, 10:23:09 PM
The DataGrid documentation describes the Columns parameter as follows:

Quote
The DataGrid Columns is an array object, which element is an array too. The element of element array is a config object, which defines every column field.

Is there another way to describe this?  I'm having difficulty understanding why it's a nested array construct.

What sort of grid does the example in the documentation produce?  Does this have something to do with the expanded rows feature?

Code:
columns:[[  
    {field:'itemid',title:'Item ID',rowspan:2,width:80,sortable:true}, 
    {field:'productid',title:'Product ID',rowspan:2,width:80,sortable:true}, 
    {title:'Item Details',colspan:4} 
],[ 
    {field:'listprice',title:'List Price',width:80,align:'right',sortable:true}, 
    {field:'unitcost',title:'Unit Cost',width:80,align:'right',sortable:true}, 
    {field:'attr1',title:'Attribute',width:100}, 
    {field:'status',title:'Status',width:60} 
]]