When I update the table with new values only the first page is updating.
When I update the table with new values only the first page is updating.
Hello,
In my table I have a column that have "Price" in it, and on my site I have an alternative that says if you what to se the price ink vat or excl vat. When the user change VATsettings only the first page of the table is reloading with the new value but all the other has the old one.
For example if I change to ink vat the first page is reload with the ink price but all the others still have excl.
This is how my code look:
$('#orderHistoryTable').DataTable({
responsive: true,
"pagingType": "full_numbers",
"lengthChange": false,
order: [],
"language": {
"paginate": {
"first": "<<",
"last": ">>",
"next": ">",
"previous": "<"
},
"sSearch" : "",
"sInfoFiltered": " - filtrerat från _MAX_ ordrar",
"info": "Visar _START_ till _END_ av _TOTAL_ ordrar"
},
columns: [
null,
null,
null,
null,
null,
null,
null,
{ type: 'numeric-comma' },
{
orderable: false,
"searchable": false
},
{
orderable: false,
"searchable": false
}
]
});
And i fill my table with data with a viewmodal.
And the price value is updating with jQuery functions.
function updatePrices(optionVAT, optionValueVAT) {
//optionVAT = inclVAT,exclVAT
//optionValueVAT InclVAT ,ExclVAT
$('.priceUpdate').each(function () {
var VAT = $('#' + optionVAT + '_' + this.id).text();
//var rowValueVAT = $('#rowValue' + optionValueVAT + '_' + this.id).text();
$(this).html(VAT); // the price of the item
//$('#rowValue_' + this.id).html(rowValueVAT); //value of the row
});
I have try use the Draw() event, but dont get it to work.