-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.8.7b10 colreorder - server side issues #151
Comments
Please provide a working samples that reproduces the issues specified above. And IMO those issues are not related to colreorder because its issues arise only after doing the columns reordering which causing column index to be "confused". |
Hi Daniel, I'm not sure if this is the issue that OP is referring to but basically what is happening is that there is an additional filter container being created. If you look at the link I'm including here: http://tempdatatables.azurewebsites.net/ (I had to use this instead of a fiddle because it only happens server side). If you drag "Header 4" to position one and then reload the page there will be an additional filter in "name (1)" column. |
Hello, this one is with filter in the footer this one is with filter in the header if you hide field1 and refresh, listing2 will have bad filter values for select if you switch field2 and field3, next use field3's select filter, you'll see the problem Maybe i do something in the wrong way, but i do not see what... Thanks again |
@johndegey and @luivis07 , go get the 0.8.7.beta.11 , let me know how it works for you (this specific fix is for ColReorder + stateSave: true. p.s @luivis07 the misplacement of the filters is related to the #119 (but anyway the whole ColReorder / statSave support is a brand new feature and not related to #119) |
Hello Daniel, The shift problem when i hide the first column seems to be fix. The problem is still there if you apply a filter to col3, then shift col3 and col4 and refresh the page. http://yadcf.johndegey.org/listing4.php John Edit: After a few test, i notice that the behavior of the datable was different when you reload the full html page than the one used when you use the next/prev button. If you reload (Ctrl F5 for windows / cmd R for os X) the html page, the xhr request use the initial position of all the columns. After the response, the datable apply the saved settings and re-order the column. columns[0][data] field1 If you change the table page with next/prev, datatable will send the xhr request with the column ordering as it is right now. columns[0][data] field1 columns[1] is now field3 I think that this may be a problem with the way yadcf works. When the order is respected in the parameters, i reply with yadcf_data_2 and yadcf_data_3 corresponding to the good column. Maybe you should do your work after the datatable reordering, or maybe you should change the yadcf_data_columnNumber to yadcf_data_columnName ??? Hope this helps |
@johndegey , please use this yadcf link file in your examples , so will be able to debug / fix it better and assign single meaningull value/filter_default_label into each select filter, e.g in field2 column place single value "field2_val" and assign it with label "field2_label" that will ease the debugging too |
@vedmack i've made the modifications, is it good for u ? (all links use your file now) |
Nope, please assign single meaningull value to each filter and a meaningful |
ok, all select have just one option value, and i set the filter_default_value for each filter, including the text ones |
I did fixed some, but... I noticed that you send the yadcf_data_X based on the reordering of the columns, the thing is that I expect that X means the original X before the re ordering of columns and yadcf will know to redirect it later on to the new position of X in the table, so my question is: can you fixate that data that belong to the original column number X? (in other words, yadcf_data_2 should hold the same values of the original column 2 no matter its current position) <-- can it be done on your side? While its not a big deal to add additional code on yadcf to take into consideration the new position of the columns when getting the yadcf_data_X I pretty sure that while I debugged your page I noticed that sometimes you are sending wrong data in those yadcf_data_X / yadcf_data__Y etc'. so I think it will be better the send those yadcf_data_X fixed to the original location of the columns. Regarding the ctrl F5 and next/prev isn't its some datatables inconsistency and not related to yadcf? |
I only have the column number send by DT. But i don't even have to use it at all because i set the "name" and "data" in the column parameter of DT. (i have to test but normally, i could remove the "name" and just keep the "data") Maybe i can use some pre-treatment on the client side to add original column number to the xhr request, but i'm not sure this is the good way. Not that i don't want to try, but i really think that the plugin should do the re-ordering. Here is the portion of code for setting the yadcf_data_x
I don't see why sometimes it should send data to wrong column number. For the CRTL F5, i don't know... i haven't do debugging for this one yet. Thx |
Regarding the columns[1][data] field2 (in F5) and columns[1][data] field3 (Paginate to next page) its really wrong IMO , I think that its must be consistent in both scenarios, so its either a your local server bug or a bug in datatables, I mean... why do you pass different values on F5 and on paginate? |
I 've posted in the DT forum Wait & see... |
@vedmack the fix you applied for stateSave = true, what exactly is it doing? because in the example here : http://tempdatatables.azurewebsites.net/, I'm already getting the ColReorder from localstorage and comparing it to the original order and setting the "column_number" to the correct value. |
@luivis07 , please disable your logic on that you have mentioned above (it messes the original column_number and eventually yadcf too) , and also use this yadcf link for better debug, I have noticed that you are not sending any |
@luivis07 are you using statesave too? And can you confirm it works for F5 and pagination ? |
@vedmack yes I'm using stateSave, pagination work, by F5 you mean refresh right? if so that works too. |
Great news @luivis07 , so... @johndegey , maybe you compare your code with @luivis07 ? |
@luivis07 : is this the good link for your test case ? |
@johndegey yes that should be working now. |
@vedmack there is now way i can add the original index to the xhr query right now Is there a way that you add the possibility to use column's name like yadcf_data_name ? @luivis07 your test case is not complete
John |
@johndegey , I think I understood what I was missing all this time, if you place a breakpoint on |
@johndegey to be honest, it would take some time for me to set up the filtering and pagination server side since I just put that page up for 1 specific reason. However, I don't see how adding the filtering will help in reproducing the bug? about the yadcf_data_xxx, this goes back to the same thing I just didn't bother setting it up. |
@johndegey , you can test your link now: http://yadcf.johndegey.org/listing4.php , I've tuned some code in yadcf (0.8.7.beta.14 on my dropbox) and it seems to work as expected |
great... everything works fine, did not find any problem when in the header position i will try again the combination of FixedHeader and the beta14 (did not work previously) Thx |
Should work now with beta15. I still need to check how show and hide works when filters in footer |
Looks like I'm done with this issue, should work for all combinations of header/footer/hidden columns, regarding the FixedHeader - its another feature that I will need to add support and not related to the current issue... |
I've found a problem when in the footer (works in the header) (i will open another case for FixedHeader when this one will be closed) |
@johndegey , 0.8.7.beta.17 is out and it looks like this issue came to an end :) , thanks for all your great test cases. |
Hello,
I've tested the beta10...
i remove the inclusion of the colreoder.js file and the capital R from the datatable DOM parameter
-> if the yadcf are in the footer : no problem, my select filters have the good options and filters the good column
-> if the adcf filters are in the header, my select filter haven't got the good option value? There is a shift (i have the hidden column and the first with no filter at all).
i do not remove the inclusion of the colreorder.js file but i only remove the capital R from the datable DOM parameter
TypeError: this.context[0]._colReorder is undefined
yadcf + colreorder + server side : problem with the selected value with select filter #150
Thanks for your work, hope this will help you
The text was updated successfully, but these errors were encountered: