DataTables_sort_wrapper removed when table.column().header().text(:new header") is use
DataTables_sort_wrapper removed when table.column().header().text(:new header") is use
jfr
Posts: 71Questions: 24Answers: 0
Hi
I am changing the header text to add the selected year at the end
jQuery(table.column(13).header()).text("Ret" + yearSelected);
and the sort wrapper is removed
This is before
<th class="neg align_right sum_mnt sorting ui-state-default" tabindex="0" aria-controls="table" rowspan="1" colspan="1" style="width: 38px;" data-column-index="13" aria-label="Ret: activer pour trier la colonne par ordre croissant">
<div class="DataTables_sort_wrapper">
Ret
<span class="DataTables_sort_icon css_right ui-icon ui-icon-carat-2-n-s">
</span>
</div>
</th>
and this is after
<th class="neg align_right sum_mnt sorting ui-state-default" tabindex="0" aria-controls="tableClient" rowspan="1" colspan="1" style="width: 90px;" data-column-index="13" aria-label="Ret: activer pour trier la colonne par ordre croissant">
Ret2013
</th>
Is there another way of changing the text without removing the sort_wapper
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi Allan
I am trying to find a solution for the DataTables_sort_wrapper removed problem
found
column().title()
that is incolumns.title
the link return a 404I thought it would be the the right one to change a title without removing the DataTables_sort_wrapper
If you have any hint , let me know
Thanks
Hi,
Thanks for letting me know about that error - there is no
column().title()
method. The links are wrong and I will remove them in the next update to the site.To do what you want to do, just modify the jQuery from your first code block slightly:
Allan
Hi Allan
Now it is keeping the the class but I have text at 2 places here is what is generated
witch give me text over text over icon
Thanks
Okay - so a little more modification of the code:
Allan
Super
I have a lot of header to do like this, so I extended the column().title() of Alejandro Navarro with the code you have given me.
So now I can retrieve and set any column title hopefully without any bug
Thanks a lot for your help
very nice - thanks for sharing that with us!
Allan