Sending JSON data in hidden columns

Sending JSON data in hidden columns

phawellphawell Posts: 28Questions: 12Answers: 1

We only wish to know your opinion on this use we are making of the hidden columns.
Do you think it's a good idea or may in the future present some kind of problem?
We populate from the server (using AJAX) our DataTables and define a column as no visible and the datafiles for that columns We send is not a string value but a JSON We use in the client for more actions and show drilldown for example.

So far, all is goes very Well but We doubt if this is a good use for a hidden column or it could be a problem in the future.

Thank you very much for your Work and support.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin
    Answer ✓

    I'm not sure I see the need to put the data into a hidden column. You could certainly do that, but why introduce the extra processing for it. You don't need to use data from the data source object just because it is there.

    Allan

  • phawellphawell Posts: 28Questions: 12Answers: 1

    Thanks for answering, What we do is get the JSON in the hidden column when users click on a drildown button associated with that file.

    Then, the JSON is used for create a Drildown with a simple table. So every file have a JSON file associated and We do not need to go to the server anymore once the page is loaded.

    As it is a hidden column its content never shows in the datatable page otherwise It shows a string like OBJECT, OBJECT, etc..

    Thank you

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    I still don't really see why you need to have it in a hidden column. As I say, just before the data is in the loaded data object, you don't need to put it into the table.

    Allan

  • phawellphawell Posts: 28Questions: 12Answers: 1
    edited January 2016

    I thought I had to send as fields and then set them as visible = false so that they are diponibles as data.

    Please, How can I send associated data to a table but are not columns?

    Thanks in advance

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    You are presumably already sending the data in whatever you are using to load the JSON. So you just wouldn't define a column that uses that data.

    There is an example of that available here - note how the loaded JSON contains information such as the email address and an extension number, but that data is not displayed in the DataTable.

    Allan

This discussion has been closed.