FixedColumns and AJAX loading

FixedColumns and AJAX loading

coryncoryn Posts: 1Questions: 1Answers: 0

Hey guys,

I have a strange bug where my DataTable with AJAX-loading enabled does not render fixed columns, the columns work fine if I disable the AJAX source (and the ajax data is valid and renders the table correclty, just without the fixed columns). Have any of you experienced anything similar?

Any help is appreciated! Thanks!

My code for table init:

    gmatrixTable = $('#gainmatrix-table').DataTable({
      data: values,
      deferRender: true,
      scrollY: fixedHeight,
      scrollX: "100%",
      scrollCollapse: true,
      fixedColumns: {
        leftColumns: 1
      },
      fixedHeader: true,
      scroller: true,
      ordering: false,
      "oLanguage": {
        "sInfo": "Showing _START_ to _END_ of _TOTAL_ CVs"
      },
      "sAjaxDataProp": "",

      "ajax": function(data, callback, settings) {
        model.get_updated_gains(function(data, error) {
          if (!error) {
            if (!model.get('isInit')) {
              console.log(
                "Redrawing Gain Matrix");
              callback(
                data
              );
            } else {
              console.log("Ajax suspended, init");
              model.conclude_init();
            }
          } else {
            console.log(
              "Failed to update Gain Matrix ",
              error);
          }
        });

      }
    });

    gainMatrixInterval = window.setTimeout(function() {
      var dt = new Date();
      var time = dt.getHours() + ":" + dt.getMinutes() +
        ":" + dt.getSeconds();
      console.log("Interval fired at: ", time)
      gmatrixTable.ajax.reload(null, false);
    }, PBF.settings.get('tuning_interval') * 1000);
This discussion has been closed.