Okay
  Public Ticket #2141447
"column type" default type and integer format
Closed

Comments

  • johanF00 started the conversation

    Hello,

    Congrats for a great plugin. We sell event tickets and we will want to use this add-on to make tables of our event participants. I have two questions please:

    - Is it possible to change the default "Column type" so it is always set to string? The problem is that the plugin incorrectly identifies some fields like telephone numbers, postal codes as integers, so the formatting is wrong, and also other fields "price" to float, that gives a wrong display format. If we have to change each column one by one, it will be a hassle.

    It would be great if all columns are always set to 'String' format by default.

    - Is it possible to change the default display of Integers? Currently is it shown as 96.326.697 we would like it as 96326697 by default.

    Looking forward to hearing from you

  •  2,496
    Aleksandar replied

    Hey johanF00.

    Thank you for your interest in our plugin.

    It sounds like you're importing an existing file, and creating a table from it, right?

    If this is true, I'm sorry to disappoint you, but there's nothing we can do about the column types. The plugin is looking at the content of each column and is defining it when you're creating the table. You can change the column type during the creation process, or afterwards, but there's no way of setting up a default column type.

    What you can do, though, is to import the source file in the database, define the column types there, and then use an SQL query to create a table. Would that work?

    To remove the thousand separator, unfortunately you would need to go into column settings and disable it - there's no global setting for this.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • johanF00 replied

    Hi Aleksandar,

    Thank you for the reply - actually my question would be for Formidable add-on. Could the Formidable add-on be set to always read columns as string by default? I am comfortable with php, if there is a snippet that I could add/modify to achieve that.

    Since the fields are set to "text" type in Formidable, I don't see why your add-on sets them to "integer". To make things worse, in the cases where there are no entries in a field, the add-on sets it as integer, and if entries come later, everything is displayed as "0".

    I really hope you guys can have a look into this matter.

    Thank you for your time and I'll be happy to provide more info if you need.

  •  2,496
    Aleksandar replied

    Hello again johanF00.

    I see. The tables created from Formidable forms are not being stored in the database, but wpDataTables actually reads the data from Formidable's tables in the database. If you have a column that is set to "text", but only contains numbers in it, the plugin will go through the database, and create a column based on values, not what you've defined the field to be in Formidable. The field type is stored in, yet another, Formidable table in the database.

    I am sorry to disappoint you, but unfortunately there's no other way of changing the column type, other than entering one value in that field which would contain a non-integer or non-float value. When you create a table from that form, you can delete that entry and it will keep the configuration as "string".

    So, if all the entries are numbers in the "text" field, simply add one entry which contains either a letter, or any other symbol other than " . " or " , " and you wpDataTables will read that as "string".

    I'll forward your request to our development team, and see if there's anything they can do for one of our future releases.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables