Hi, Chris!

Please play around with my example. It's a modification of the Playground
example. You can copy my code in the Playground.

At the top of the code there is a constant named "columnCount". This is the
number of columns for the table and there will also the same number of
header renderer created. In the example I just use the default renderer to
keep the code simple. With 60 columns the example runs ~45sec. Be careful to
increase the number too fast! I told you that the correlation of columns
count and time unfortunately isn't linear!
Try steps of 10 and have a look of the CPU usage graph. to see what happens
with the width of the curve.

Best regards,
Stefan


Please copy the following example to the Playground:
//----------------------------------------------------------------------------------

const columnCount = 60;

function createRandomRows(rowCount) {
  var rowData = [];
  var now = new Date().getTime();
  var dateRange = 400 * 24 * 60 * 60 * 1000; // 400 days
  var nextId = 0;
  for (var row = 0; row < rowCount; row++) {
    var date = new Date(now + Math.random() * dateRange - dateRange / 2);
    rowData.push([ nextId++, Math.random() * 10000, date, (Math.random() >
0.5) ]);
  }
  return rowData;
}

// window
var win = new qx.ui.window.Window("Table").set({
  layout : new qx.ui.layout.Grow(),
  allowClose: false,
  allowMinimize: false,
  contentPadding: 0
});
this.getRoot().add(win);
win.moveTo(30, 40);
win.open();

// table model
var tableModel = new qx.ui.table.model.Simple();
var columns = [];
for(var i = 0; i < columnCount; i++) { columns[i] = "Col" + i; }
tableModel.setColumns(columns);
tableModel.setData(createRandomRows(10));

// table
var table = new qx.ui.table.Table(tableModel).set({
  decorator: null
});
win.add(table);

var tcm = table.getTableColumnModel();

// Display a checkbox in column 3
tcm.setDataCellRenderer(3, new qx.ui.table.cellrenderer.Boolean());

// use a different header renderer
tcm.setHeaderCellRenderer(2, new
qx.ui.table.headerrenderer.Icon("icon/16/apps/office-calendar.png", "A
date"));

for(var j = 0; j < columns.length; j++)
{
  var headerCellRenderer = new qx.ui.table.headerrenderer.Default();
  headerCellRenderer.setToolTip("C" + j);
  headerCellRenderer.setUserData("iCol", j);
  tcm.setHeaderCellRenderer(j, headerCellRenderer);
}




--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Setting-own-table-header-renderers-are-very-slow-in-big-tables-tp7585249p7585259.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to