Hi Guys I have 2 datatables
dtInvoices & dtInvoiceDetails
dtInvoice has the following columns
date - orderNo - net - vat -Total
I have 2 methods of editing dtInvoiceDetails inline & the editor window.
In this table I have columns
quant - sell - nett - lineTotal - vatRate
What is the event so I can calculate the lineTotal when the quant/ sell amounts change ( either by inline or the editor window)
I also have need the sum of lineTotal to add to the dtInvoice table.
I have this so far.
On the dtInvoice click
$('#dtInvoices').on( 'click', 'tbody td', function () {
//alert( tableInvoices.cell( this ).data() )
currentSelectedInvoiceIndex = tableInvoices.row( this ).index() ;
alert(currentSelectedInvoiceIndex);
} );
The invoice total is column 2 so I can set the sum to cell(currentSelectedInvoiceIndex,2)
I can't find an example showing this.
So I need
- Get the onChange event of a row/cell and calculate the line total
- Then calculate the sum of the column lineTotal
- Set the total in dtInvoices.
Cheers
Steve Warby