How to save data in database?
I want to click on save button and write the columns to database. eg. insert into table1(param1, param2) values (1000, 10…)
dp = new dataProcessor({yourselfurl});
On server side you must evaluate the datas and save into yout db.
yout = your
By default, dataProcessor is initialized in the auto-update mode, i.e. after each change in the grid data is sent to the server. In some cases it makes sense to use the manual update mode:
dp.setUpdateMode("off")
...
dp.sendData();
Also note that the updating of the data in the grid is row-orientated:
dp.sendData(rowId);
In some cases
In which cases?
a) DataProcessor will send all updated rows to the server side. Not the single columns but data from all columns ( it can be limited to single column, but in such case you will need to have a custom server side code, because native connector will not work )
b) DataProcessor sends only updated rows. So you need to mark them as updated ( normally they marked automatically after edit operation )
mygrid.forEachRow(function(id){
dp.setUpdated(id);
});
dp.sendData();
In which cases?
There two data saving strategy
a) save as user edit anything ( auto-update mode )
b) allow to change many values and save data only when user press some kind of save button ( manual update mode )