Hi paramvir.
I have 2 questions.
1) Regarding cell data calculation, I applied the rowTemplate that you informed me on April 8, but it did not work as I wanted.
So, I modified it as follows and got the result I wanted, so please review it.
if(rd.cd_kind == 4){
Object.defineProperty(rd, 'qty1', {
enumerable: true,
get (){
var rd = this, ri = rd.pq_ri, pdata = grid.pageData(),
pre_month_stock = rd['total_pre_month'],
day = (pdata && pdata[ri-4])? pdata[ri-4].qty1: 0,
night = (pdata && pdata[ri-3])? pdata[ri-3].qty1: 0,
shipment = (pdata && pdata[ri-2])? pdata[ri-2].qty1: 0,
etc = (pdata && pdata[ri-1])? pdata[ri-1].qty1: 0;
return pre_month_stock + day + night - shipment - etc;
}
}),
Object.defineProperty(rd, 'qty2', {
enumerable: true,
get (){
var rd = this, ri = rd.pq_ri, pdata = grid.pageData(),
pre_day_stock = (pdata && pdata[ri])? pdata[ri].qty1: 0,
day = (pdata && pdata[ri-4])? pdata[ri-4].qty2: 0,
night = (pdata && pdata[ri-3])? pdata[ri-3].qty2: 0,
shipment = (pdata && pdata[ri-2])? pdata[ri-2].qty2: 0,
etc = (pdata && pdata[ri-1])? pdata[ri-1].qty2: 0;
total_this_month = pre_day_stock + day + night - shipment - etc;
return total_this_month;
}
}),
....
Object.defineProperty(rd, 'total_this_month1', { // March Results
get (){
return total_this_month;
}
})
}
2) Another question is, as in the attached image,
if the user accesses this screen again after saving the value set by the user to show/hide the column in the DB,
the value is retrieved from the DB and the previously set value is saved.
I want to display it on the screen in the form.
When the Save button is clicked, I want to save the changed value of the cell and the display/hide setting value of the column at the same time in the DB.
I would really appreciate it if you could let me how.