Column Type
Column Type
samsamtest
Posts: 52Questions: 15Answers: 1
Hi I need some help.
What type of column types can I select ?
Is it posible to say if a column is integer, Decimals, Text, Procent etc.
I read here Column-type that if I use server side that its not possible ?
Thanks kind
Sam
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The column type is used for sorting purposes. When using client side processing Datatables automatically sets the type by looking at the data in each column. If all the data is of a particular type it will set the column to that. For example if there is a column of numbers it will set to the
num
type but if there happen to be other types of data in that column it won't set it tonum
. Forcing it tonum
withcolumns.type
won't help the soritng.As you noted in the docs:
In this case sorting is performed by the server and Datatables displays the table in the order returned from the server.
Is there a particular issue you are trying to solve?
Kevin
Hi, thanks for te quick respons,
Yes it is example in one column we have the month 01, 02, 03, 04 etc. But when it comes to the table it changes to 1. I am able to take way the number_format and round from the php code but then all the number will have decimals etc. The data we have can be mixed etc. So I am trying to build a select were you can selet what type of data column 1 is etc.
And that I want have the possibility to say if it is going to be on the left or right side etc..
I HAVE SOLVED THIS BY CREATING WHAT TYPE OF COLUMNS I HAVE. IN PH SOURCE LEVEL WITH TWIG ETC.