Hi Paramvir,
The checkbox is not working properly:
1) If data value has true then checkbox display correctly but when I un-check the checkbox then the value set as "false" string-like yellow color box.
2) If data has false then display "false" string as a blue color box.
Below my checkbox code: I have Parent-child grid (first child as skip checkbox)
{
title: datasetnames[k], menuInClose: true, sortable: false,
align: "center", colModel: [ {
title: "", width: "2%", sortable: false,
align: "center",
exportRender: false,
nodrag: true,
nodrop: true,
type: 'checkbox',
dataIndx: "skip_" + datasetnames[k],
dataType: 'bool',
cb: { all: true, header: false }
},
{
title: "Data", sortable: false,
width: "15%",
dataType: "string",
dataIndx: datasetnames[k],
cls: 'hideLeftborder',
nodrag: true,
nodrop: true,
filter: { crules: [{ condition: 'contain' }] }
}]
}
3) Before first-second points, I have to use below code for render checkbox code Is working completely but adding a new column by context menu then render event not working and when saving button click then I have not got value in browser console tab as grid.getChanges({ format: "byVal" })
{
title: datasetnames[k], menuInClose: true, sortable: false,
align: "center", colModel: [ {
title: "", width: "2%", sortable: false,
render: function (ui) {
var rowData = ui.rowData,
dataIndx = ui.dataIndx;
ldataIndx = datasetnames[k];
rowData.pq_cellcls = rowData.pq_cellcls || {};
if (rowData[dataIndx] == true) {
rowData.pq_cellcls[dataIndx] = 'grey';
rowData.pq_cellcls[dataIndx.split("skip_")[1]] = 'grey';
return "<input type='checkbox' " + (ui.cellData ? "checked='checked'" : "") + " />";
}
else {
rowData.pq_cellcls[dataIndx] = '';
rowData.pq_cellcls[dataIndx.split("skip_")[1]] = '';
return "<input type='checkbox' " + (ui.cellData ? "checked='checked'" : "") + " />";
}
},
align: "center",
exportRender: false,
nodrag: true,
nodrop: true,
type: 'checkbox',
dataIndx: "skip_" + datasetnames[k],
dataType: 'bool',
cb: { all: true, header: false }
},
{
title: "Data", sortable: false,
width: "15%",
dataType: "string",
dataIndx: datasetnames[k],
cls: 'hideLeftborder',
nodrag: true,
nodrop: true,
filter: { crules: [{ condition: 'contain' }] }
}]
}
Thank you,
Jignesh