You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-12Lines changed: 21 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,7 @@ the components look more like Bootstrap.
30
30
31
31
## Getting Started
32
32
33
-
[Working sample](sample/index.html)
34
-
that goes with this introduction.
33
+
[Working sample](sample/index.html) that goes with this introduction.
35
34
36
35
### 0) Import
37
36
@@ -82,6 +81,7 @@ Available options are:
82
81
*`name`: The name of the column.
83
82
*`type` (default: `"string"`) : The datatype of the columns. Options are: `string`, `date`, `number`
84
83
and `boolean`.
84
+
*`field`: This is mostly for use when in the data passed in the rows are an object rather than an array, in which case this attribute is used to lookup which value to show in which cell.
85
85
*`visible` (default: `false`): Whether or not the column is visible or not. This allows for
86
86
hiddend data columns, such as ID fields etc.
87
87
*`filterType` (default: `list`): The type of filter to display for the column.
@@ -103,21 +103,30 @@ Available options are:
103
103
You can get the data using an AJAX call (`$.getJSON()`) or generate it in your
104
104
JavaScript.
105
105
106
-
The format expected is an Array, that contains an array for every row. The
107
-
grid will map every element in the row array to the column at the same index.
106
+
The table takes and array of rows. These rows can be either arrays or regular objects. In case objects are supplied the `field` attribute needs to be set on the columns, so the table knows which column to map which field to.
108
107
109
-
To hide items in the array, add invisible columns to the column list.
108
+
When the rows are arrays the table will map the field by index to the respective column.To hide items in the array, add invisible columns to the column list.
{id :10001, name :"Bill Smith", birthDate :newDate(1956, 3, 12).getTime(), country :"United States", state :"Texas", note :"Test", language :"English"},
127
+
{id :10002, name :"Michael Jones", birthDate :newDate(1975, 7, 23).getTime(), country :"United States", state :"Florida", language :"English"},
128
+
{id :10003, name :"Heinz Mayer", birthDate :newDate(1972, 8, 2), country :"Germany", state :"Bayern", language :"German"},
0 commit comments