I would like to set the width of the column with javascript according to window size. I've tried the following javascript code but it does not work:
var treegridObj = $("#treeGrid").data("ejTreeGrid");
var numColumns = treegridObj.model.columns.length - 2;
var swidth1 = $(window).width() - lOffset - rOffset;
var colWidth = (swidth1 - 445) / numColumns;
for (var i = 2; i < treegridObj.model.columns.length; i++) {
treegridObj.model.columns[i].width = 10;
treegridObj._columnsWidthCollection[i] = 10;
}
treegridObj.refreshContent();
treegridObj.renderRecords();
Can you help me? Thanks.
Best regards.