nnhatnam / jquery-datatables-column-filter

Automatically exported from code.google.com/p/jquery-datatables-column-filter
0 stars 0 forks source link

Fix for select filter not repopulating after multiple ajax reloads #135

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. reload ajax on data table more than one time

What is the expected output? What do you see instead?
Expected: select dropdown should update with new table data
Actual: Select dropdown contains the values from the first ajax load

What version of the product are you using? On what operating system?
columnFilter 1.5.1, Windows 7

Please provide any additional information below.

I was able to correct this by modifying line 397, which is in the 
fnCreateSelect function, by changing the line:
if (oSettings.iDraw == 2 && oSettings.sAjaxSource != null && 
oSettings.sAjaxSource != "" && !oSettings.oFeatures.bServerSide) {

to:

if (oSettings.iDraw >= 2 && oSettings.sAjaxSource != null && 
oSettings.sAjaxSource != "" && !oSettings.oFeatures.bServerSide) {

Each reload increments the iDraw counter by one, so after the first refresh, it 
would not update the dropdown any longer.  Changing oSettings.iDraw == 2 to 
oSetting.iDraw >= 2 fixes that issue.

Original issue reported on code.google.com by tanner.c...@gmail.com on 25 Sep 2013 at 2:14