• alexylem

    (@alexylem)


    I have a table from an SQL source with one column that have PHP serialized array data.
    a:3:{s:1:"a";i:1;s:1:"b";i:2;s:1:"c";i:3;}

    I tried to use render option in columnDef from datatables but the plugin settings does not allow to have a function in the settings object, only valid JSON.
    That is not even a good approach since I would need to manually parse the data in the JS function…
    Ideally a new apply_filter on the data from the SQL query result before it is used to build the table (gdoc_html is too late). Probably around:
    https://github.com/fabacab/inline-gdocs-viewer/blob/6f9858ddab6860e056b6f373e74460666beb8260/inline-gdocs-viewer.php#L651
    This way I would add_filter, identify the right column and return unserialized data.

    Do you see any other approach before I modify the plugin?
    Thanks in advance,
    Alex.

    • This topic was modified 4 years ago by alexylem.
  • The topic ‘How to filter/render/format data (need to unserialize data)’ is closed to new replies.