Hi All,
Has anyone worked with 'getRecordSummary' property of ListGridField object.
I am have defined a field of 'summary' type to show total of each row in LisGrid, but the 'getRecordSummary' function only executes once (during load). It does not update the totals when I update the fields in that row.
I want that when ever I update any field in row, total column of that row should automatically update as per the logic implemented in 'getRecordSummary' method.
Kindly help, if someone knows the solution, below is the code of ListGridField of 'summary' type.
Has anyone worked with 'getRecordSummary' property of ListGridField object.
I am have defined a field of 'summary' type to show total of each row in LisGrid, but the 'getRecordSummary' function only executes once (during load). It does not update the totals when I update the fields in that row.
I want that when ever I update any field in row, total column of that row should automatically update as per the logic implemented in 'getRecordSummary' method.
Kindly help, if someone knows the solution, below is the code of ListGridField of 'summary' type.
Code:
{ type:"summary", summaryFunction:"sum", showGridSummary:true, getRecordSummary: function calculate_row_summary(record, field){ if (record.no_of_passengers == undefined) { record.no_of_passengers = 0; } if (record.base_fare == undefined) { record.base_fare = 0; } if (record.tax == undefined) { record.tax = 0; } if (record.supplier_markup == undefined) { record.supplier_markup = 0; } if (record.comission_amount == undefined) { record.comission_amount = 0; } if (record.agent_markup == undefined) { record.agent_markup = 0; } var single_pax_total = eval(record.base_fare + '+' + record.tax + '+' + record.supplier_markup + '+' + record.comission_amount + '+' + record.agent_markup); var row_total = record.no_of_passengers * single_pax_total; alert(row_total); return row_total; }, title:"Total", required:true, prompt:"Total Amount", canEdit:false, name:"total" }
Comment