I am currently working on a project in DOJO
and struck at this point.
I am using dgrid in dojo to generate table and I need to have checkbox in the first column.
Here is Code that is working fine but my requirement is different.
I am taking values for headers and data from a JSON
file
Here is the Json file ABC.JSON :
{
"properties": {
"dataLoading": "full",
"classNames": ["abc"],
"autoRefresh": 60,
"sort" : [ {"attribute":"raiseTime", "decending":true} ]
},
"columns": [
[[
{ "field":"abc","label":"my label","sortable":true },
{ "field":"def","label":"second label","sortable":true }
]],
[[
{ "field":"fgh", "label":"third label","sortable":true },
{ "field":"ijk", "label":"fourth label","sortable":true }
]]]
}
But to have checkbox feature in table we should have :
var grid = new SelectionGrid({
columns: [
selector({ label: '' }),
{ field: 'firstName', label: 'First Name', sortable: false },
{ field: 'lastName', label: 'Last Name', sortable: false }
],
selectionMode: 'none'
}, 'grid');
So, In my JSON
I need to call selector()
on label. How can I do that in JSON
? Is there any way?