I am using dgrid/Grid for displaying data into grid. I want to add/delete selected rows from the grid and update the database. How can I do that? Any help would be appreciated.
require([ 'dojo/_base/declare', 'dstore/RequestMemory', 'dgrid/Grid',
'dgrid/extensions/Pagination', 'dgrid/Selection' ],
function(declare, RequestMemory, Grid, Pagination, Selection,
Dialog, Button) {
var structure = [ {
label : "Value Date",
field : "valueDate"
}, {
label : "Currency",
field : "currency"
}];
var grid = new (declare([ Grid, Pagination, Selection ]))({
collection : new RequestMemory({
target : 'getdata'
}),
columns : structure,
className : 'dgrid-autoheight',
loadingMessage : 'Loading data...',
noDataMessage : 'No results found.',
}, 'grid');
grid.startup();
});
Use this : -
Use same delete function for add and update after change method.