Hi,
I have two grids on a Popup Edit of another grid and want to move data rows between the two grids on Popup.
As of now able to maintain the check-box check state on the grid during refresh as below.
And I am looking for is to select the row when the check-box is checked and Unselect the row when check box is unchecked even when grid is refreshed.
(Note: Grid as of now not at set to [selectable: "multiple"] and let me know if this is required.)
$("#availableAgentsGrid").kendoGrid({
dataSource: agentdataSource,
dataBound: function () {
//On Grid Databound Maintain the state of Checkbox when grid refresh on .
for (agent in avAgentCheckedarray) {
if (avAgentCheckedarray[agent]) {
$('#'+agent).attr('checked', 'checked');
}
}
//Set agent Check box; Check and Uncheck Action Event
$('#availableAgentsGrid tbody').on('click', ':checkbox', function () {
var id = availableAgentGridData.dataItem($(this).closest('tr')).AgentID;
if ($(this).is(':checked')) {
avAgentCheckedarray[id] = true;
$('#' + id).attr('checked', 'checked');
} else {
avAgentCheckedarray[id] = false;
$('#' + id).removeAttr("checked");
}
});
},//End of Databound
columns: [
{ field: "AgentID",
title: "<input id='acheckAll', type='checkbox', class='checkbox' />",
width: 50,
filterable: false, sortable: false,
template: "<input type='checkbox' class='checkbox' id='${AgentID}' />" //define template column with check-box and attach click event handler
},
});// End of #availableAgentsGrid
availableAgentGridData = $('#availableAgentsGrid').data().kendoGrid;
Thanks,
Chatrapathi Chennam
I have two grids on a Popup Edit of another grid and want to move data rows between the two grids on Popup.
As of now able to maintain the check-box check state on the grid during refresh as below.
And I am looking for is to select the row when the check-box is checked and Unselect the row when check box is unchecked even when grid is refreshed.
(Note: Grid as of now not at set to [selectable: "multiple"] and let me know if this is required.)
$("#availableAgentsGrid").kendoGrid({
dataSource: agentdataSource,
dataBound: function () {
//On Grid Databound Maintain the state of Checkbox when grid refresh on .
for (agent in avAgentCheckedarray) {
if (avAgentCheckedarray[agent]) {
$('#'+agent).attr('checked', 'checked');
}
}
//Set agent Check box; Check and Uncheck Action Event
$('#availableAgentsGrid tbody').on('click', ':checkbox', function () {
var id = availableAgentGridData.dataItem($(this).closest('tr')).AgentID;
if ($(this).is(':checked')) {
avAgentCheckedarray[id] = true;
$('#' + id).attr('checked', 'checked');
} else {
avAgentCheckedarray[id] = false;
$('#' + id).removeAttr("checked");
}
});
},//End of Databound
columns: [
{ field: "AgentID",
title: "<input id='acheckAll', type='checkbox', class='checkbox' />",
width: 50,
filterable: false, sortable: false,
template: "<input type='checkbox' class='checkbox' id='${AgentID}' />" //define template column with check-box and attach click event handler
},
});// End of #availableAgentsGrid
availableAgentGridData = $('#availableAgentsGrid').data().kendoGrid;
Thanks,
Chatrapathi Chennam