In Column Visibility i have 10 values can those be Alphabetically sorted, keeping Table order untoch
In Column Visibility i have 10 values can those be Alphabetically sorted, keeping Table order untoch
vivbrock04
Posts: 4Questions: 1Answers: 0
Example:
I have Columns
First Name
Last Name
Age
Salary
Country
there colums in table are same as mentioned above, but in Column Visibilty dropdown I want these colum names should be
Sorted Alphabetically : like:
Age
Country
First Name
Last Name
Salary
Is there any way to sort Colum Visibilty Values.
This discussion has been closed.
Answers
The
colvis
button will create the buttons in the same order as they appear in the table. If you'd like them in a different order, you'd need to create a custom list (collection
) which uses multiplecolumnToggle
buttons, in the order that you want.Allan
Thanks for the Remark but am looking for Button ordering Feature what we have in earlier version of colVis.
Example:
http://www.the-inspection-company.com/DataTables-1.10.5/extensions/ColVis/examples/button_order.html
How can we achive this in new Button ColVis Impl.
As I say, you would have to use multiple
columnToggle
buttons, in the order that you want them to be in.Allan
is ther any way i can have toggle buton as dropdown, coz i have 40+columns and displaying all 40+ column as individaul button on top of table does not look nice.
any suggestion or example for same would be helpful.
You can still have a dropdown collection exactly like the
colvis
button does. Just put your buttons inside a collection -collection
.Allan
Now i have different Problem,
When am using Column Visibility and Column Reordering :
how till i get to know which all column are visible and in what order to save the prefrence to database.
1) How to get visible column (index or ID ?)
2) how to get what is the Order of all Hidden as well as Visiible Column (index or id??)
suppose i have 6 column : col1, col2, col3, col4, col5, col6:
and out of 6, four are visible: col1, col3, col5, col6
and the order of those column's are:
Col1 | Col5 | Col6 | Col3
so how to get columns index which are visible only(like 1,3,5,6) and how to get the order(1,2,5,6,4,3)
Facing difficulty in geeting what are the colum's are Visible in table...
so that i can save those prefrence in database.