Issue with refreshing DataTable on change of value from dropdown selection
Issue with refreshing DataTable on change of value from dropdown selection
Have a list of countries in a dropdown, on selection of country i am calling a function in which the datatables are initialized and fetching data from server and displaying. But if i try to select any other country, the function is being called but datatables are not fetching data again.
I learnt there is fnDraw method from blogs but i am confused where to use this.
I tried using at the first line in the function call but facing issues as the datatables will not initialized at that point.
Here is my select tag, function code also.
Please help me where to use fnDraw in my case to re-initialize the data from server.
Select Country
function selectCountry(Country)
{
ctry = Country.value;
$("#SellOut").dataTable({
"sPaginationType": "full_numbers",
"sAjaxSource" : 'dataentryconfig/FetchConfigTable.html?Country='+Country.value,
"bJQueryUI": true,});
$("#SellIn").dataTable({
"sPaginationType": "full_numbers",
"sAjaxSource" : 'dataentryconfig/FetchConfigTable.html?Country='+Country.value,
"bJQueryUI": true,});
$("#Inventory").dataTable({
"sPaginationType": "full_numbers",
"sAjaxSource" : 'dataentryconfig/FetchConfigTable.html?Country='+Country.value,
"bJQueryUI": true,});
}
I learnt there is fnDraw method from blogs but i am confused where to use this.
I tried using at the first line in the function call but facing issues as the datatables will not initialized at that point.
Here is my select tag, function code also.
Please help me where to use fnDraw in my case to re-initialize the data from server.
Select Country
function selectCountry(Country)
{
ctry = Country.value;
$("#SellOut").dataTable({
"sPaginationType": "full_numbers",
"sAjaxSource" : 'dataentryconfig/FetchConfigTable.html?Country='+Country.value,
"bJQueryUI": true,});
$("#SellIn").dataTable({
"sPaginationType": "full_numbers",
"sAjaxSource" : 'dataentryconfig/FetchConfigTable.html?Country='+Country.value,
"bJQueryUI": true,});
$("#Inventory").dataTable({
"sPaginationType": "full_numbers",
"sAjaxSource" : 'dataentryconfig/FetchConfigTable.html?Country='+Country.value,
"bJQueryUI": true,});
}
This discussion has been closed.