From 376db8fe9fbdf5f7f5210076d431205090ff4e2b Mon Sep 17 00:00:00 2001 From: Tony Germaneri Date: Mon, 22 Jan 2018 14:35:11 -0800 Subject: [PATCH] added height/width constraint to canvas-datagrid --- demos/datagrid/README.md | 7 +++++++ demos/datagrid/index.html | 2 ++ 2 files changed, 9 insertions(+) diff --git a/demos/datagrid/README.md b/demos/datagrid/README.md index 40743fd..7ffc6b0 100644 --- a/demos/datagrid/README.md +++ b/demos/datagrid/README.md @@ -34,6 +34,13 @@ var grid = canvasDatagrid({ }); ``` +For large data sets, it's necessary to constrain the size of the grid. + +```js +grid.style.height = '100%'; +grid.style.width = '100%'; +``` + Once the workbook is read and the worksheet is selected, assigning the data variable automatically updates the view: diff --git a/demos/datagrid/index.html b/demos/datagrid/index.html index c2f50e1..25d01c1 100644 --- a/demos/datagrid/index.html +++ b/demos/datagrid/index.html @@ -64,6 +64,8 @@ var process_wb = (function() { /* update canvas-datagrid */ if(!cDg) cDg = canvasDatagrid({ parentNode:HTMLOUT, data:data }); + cDg.style.height = '100%'; + cDg.style.width = '100%'; cDg.data = data; XPORT.disabled = false;