If I using template and editable.
So when you edit the first record it will automatically set to the value of the latter.
I have for example 3 rows.
AAA | 111
BBB | 222
CCC | 333
If I click first row.
My grid will be:
CCC | 111
BBB | 222
CCC | 333
My grid code:
var locationData = {
columns:[
{field: "location", title: "Name"},
{field: "serial", title: "Serial Number"}
],
filterable: false,
sortable: true,
pageable: true,
scrollable: false,
selectable: true,
editable: true,
height: 200,
theme: uiTheme,
rowTemplate: chargePointRowTemplate,
dataSource: chargePointsDataSource
};
var chargePointsDataSource = new kendo.data.DataSource({
data:restData,
pageSize:5,
serverPaging:false,
serverSorting:false,
schema:{
data:function (result) {
return result.points.testpoints
},
total:function (result) {
if (result.points) {
return result.points.PageSize;
} else {
return result.length || 5;
}
},
model: {
id: "serial",
fields: {
location: { editable: true, type: "string", nullable: true },
serial: { editable: false, type: "string", nullable: false }
}
}
}
});
var chargePointRowTemplate = kendo.template(
"<tr><td height='20'>#= location #</td><td height='20'>#= serial #</td><td height='20'><div class='status-item_#= status #'></div></td></tr>"
)
So when you edit the first record it will automatically set to the value of the latter.
I have for example 3 rows.
AAA | 111
BBB | 222
CCC | 333
If I click first row.
My grid will be:
CCC | 111
BBB | 222
CCC | 333
My grid code:
var locationData = {
columns:[
{field: "location", title: "Name"},
{field: "serial", title: "Serial Number"}
],
filterable: false,
sortable: true,
pageable: true,
scrollable: false,
selectable: true,
editable: true,
height: 200,
theme: uiTheme,
rowTemplate: chargePointRowTemplate,
dataSource: chargePointsDataSource
};
var chargePointsDataSource = new kendo.data.DataSource({
data:restData,
pageSize:5,
serverPaging:false,
serverSorting:false,
schema:{
data:function (result) {
return result.points.testpoints
},
total:function (result) {
if (result.points) {
return result.points.PageSize;
} else {
return result.length || 5;
}
},
model: {
id: "serial",
fields: {
location: { editable: true, type: "string", nullable: true },
serial: { editable: false, type: "string", nullable: false }
}
}
}
});
var chargePointRowTemplate = kendo.template(
"<tr><td height='20'>#= location #</td><td height='20'>#= serial #</td><td height='20'><div class='status-item_#= status #'></div></td></tr>"
)