Columntoggle table refresh ignores columns toggle state #6673
Comments
A (related?) problem:
At this point, all column headers will appear, but their data will shifted by one. |
I have the same Issue, any help? |
This is still an issue for me using JQM 1.4.2. Calling .table('refresh') activates all columns of a columntoggle table. Following through the src around line 13506 of jquery.mobile-1.4.2.js: when refresh is called for columntoggle tables, _unlockCells is called on all table nodes with 'ui-table-cell-hidden' and 'ui-table-cell-visible' classes. This removes those classes from those nodes. Then, the column menu gets recreated and the checked state is set based on the 'cells' jqmData on the checkbox. If the first cell has a css 'display' value of 'table-cell' then the box gets checked. I'm not seeing any code that sets the 'ui-table-cell-hidden' or 'ui-table-cell-visible' classes on nodes except for in response to clicking the check boxes, so perhaps this is not being saved or restored in any way? |
same problem here, also on jqm 1.4.2 |
I agree, I just ran into this issue today. When using the method $("#data-table").table("refresh"); I am simply repopulating a table with new row data and keeping the headings the same. If I don't use the refresh method, then the table doesn't function correctly - all the fields appear in each row for the new data that is added. If I call the refresh method, the column settings that were toggled by the user are all reset, which is really just an inconvenience. I would like to set it up so that the column toggled settings are preserved after new data is added/removed from the table. Has anyone found a workaround yet? |
My workaround was to write my own column toggling code ;) I'm using knockout, so it was fairly simple to create a column model for each table, bind the elements to the booleans in the models, and then create a popup menu just like jqm's that allows for toggling the visibility in the view model. |
I know it's not pretty good but i did this :/ Line 13456:
and Line 13502:
Maybe it's can help someone for a good coding ? I don't know... Peace |
No longer an issue with latest master. |
When refreshing a "columntoggle table" the currently toggled columns state is ignored.
http://jsbin.com/ofuhaw/741/
To start the page should be wide enough that column 3 is showing, and have the console ready.
Now hide column 3 using the "Columns..." menu
Call "addNewRow()" which will add a row and refresh the table.
It should only show 3 columns, namely column 1,2 and 4.
The new row and the header shows all 4 columns, while other/previous rows only show column 1,2 and 4.
Google Chrome Version 30.0.1599.101 m
Mozilla Firefox Version 24.0
both on a desktop running windows 7 Ultimate 32 bit
jquery-1.10.1.js
jquery.mobile-1.4.0-alpha.2.css / jquery.mobile-git.js (a few minutes before submiting this)
May or may not be related to this bug Growing CPU use and memory leak in columntoggle table refresh when using data-priority #6683
The text was updated successfully, but these errors were encountered: