Issue Datatable header Columns

edited December 2016 in Technical questions

I found this issue on Datatables

  • 1) Load the datatable
  • 2) Click a custom save button and save in database the State of Datatable so that I can have different views/states of my datatable.
  • 3) Resize one column from Datatable
  • 4) From a selectpicker where I load the saved views/states select one and then use setState to load the saved state.
  • 5) The header columns are gone

http://fs5.directupload.net/images/161223/yhluiwr3.png

Comments

  • Can you please provide a demo where the mentioned behavior can be tested?

  • Hi,

    found my code problem and would like to mention it here for feedback

    I save different states of one datatable in database using getState and then save it in database as

    $record["state"] = (string) json_encode($state);
    

    but saving it as JSON then my widths in state are strings

    ,"size":["50","80","230","220","180","80","150","130","130","150","150","150","130","170","170","120","150","150","150","150","150","150","150","150","150","150","200","200","100","80","150","150","150","150","200","200","150","150","150","150","80","200"],
    

    So when I try to load one of the datatable saved states in database then the webix try to make
    additions of the widths but they are strings so I have concatenations than math addition.

    This destroy the CCS left property on the columns like this

      <div column="4" class="webix_column " style="width: 180px; 
       left: 360220px; top: 0px;">
    

    So as solution you can save the JSON state in database using the flag

      $record["state"] = (string) json_encode($state, 
    JSON_NUMERIC_CHECK);
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!