Something wrong with hidden cols , ordering and order indicator
Something wrong with hidden cols , ordering and order indicator
useppewind
Posts: 19Questions: 0Answers: 0
As I wrote in the title, when I click on column B or E or H or S or T, it's all ok.
On the other columns the indicators fail: A, C, D, F, G, I, J, L, Y.
Replies
Agreed - thanks for the test case. I'll get back to you when I have a fix.
Allan
Some news?
A workaround: there are columns on which the order target is on the 'next' column, but if I invert the two columns and set the target on the previous then it works
No news within the few hours between my post and your bump. I'll update this thread when I've had a chance to work on this.
Allan
The workaround does not work
let's try to fix the fiddle
I've just committed a fix for this issue.
It will be included in DataTables 2.0.1 which will land soon.
Thanks again for the test case.
Allan
In the fiddle on the first post it still does not work
I had misunderstood the issue a little bit, apologies.
What is happening is that you are using
columns.orderData
to tell DataTables to order the table by the contents of a different column (the hidden columns). What is happening is that it is ordering that correctly, and it icon is shown on that hidden column (which you can see if you make it visible), since ordering is on that column!Perhaps a better way to do this is to use orthogonal data - have a rendering function that returns the secondary column's data for sorting:
https://live.datatables.net/lixaculo/4/edit
If you were ajax loading the data, this has the benefit that you would not need the hidden columns at all.
Allan
Great!!!! this is what I needed. Here is the correct fiddle
https://live.datatables.net/lixaculo/5/edit
Thank you @allan
Another problem: if I change the order as here:
https://live.datatables.net/lixaculo/6/edit
I have put only "order: [16, 'desc']," then two indicators go crazy in column A and F
on 1.3.11 it is all ok, I am downgrading now
There is indeed something wrong there - thanks for letting me know. I'll look at it as soon as I can.
Allan
any news?
No sorry. I've had to prioritise other things.
Hi Allan
Hello
I've not looked at this yet. Sorry. Too many other things to do recently.
Allan
ok, I can confirm that the build 2.0.8 has almost solved this problem
Almost? What is not yet correct? Here is a little example with 2.1-dev which I'm working on just now - if you can build a set of steps or an example using that which show the issue with the latest code, I'll try to look into it.
Thanks,
Allan
Almost done.
https://live.datatables.net/lixaculo/9/edit
Here you can see to the left of the column labeled "SSS" there are a couple of "orphaned" indicators.
BTW good job
Are those floating sort indicators to the left of
SSS
not from the empty header cell just before it:<th rowspan="2"></th>
?I think that looks like it is displaying correctly as configured to me?
Allan