Changing table's width after load in Handsontable

313 views
Skip to first unread message

Asaf David

unread,
Jul 12, 2015, 5:10:09 AM7/12/15
to handso...@googlegroups.com
I'm trying to add a button that will make the table get 100% width. I can see that the settings do change when checking with table1.getSettings(), but the table doesn't change. 

html:

 <div id="table1" class="table"></div> <button id="fullWidth">Strech to full width</button>



 css: 

 .table1 {width: 100%;}



 JS: 

 var myData = Handsontable.helper.createSpreadsheetData(10, 5); var container = document.getElementById('table1'); var table1 = new Handsontable(container, {data: myData, stretchH: "none", colHeaders: true }); Handsontable.Dom.addEvent(fullWidth, 'click', function () { table1.updateSettings({ stretchH: "all" }); });



java...@gmail.com

unread,
Jul 14, 2015, 2:20:03 PM7/14/15
to handso...@googlegroups.com
Yes! This is my concern too.

Ivan Ogasawara

unread,
Jul 14, 2015, 2:30:32 PM7/14/15
to java...@gmail.com, handso...@googlegroups.com
this question is very interesting.
I think you may open a issue on github about this question.


my best regards


--
You received this message because you are subscribed to the Google Groups "Handsontable" group.
To unsubscribe from this group and stop receiving emails from it, send an email to handsontable...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages