ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Setting ngGrid column definition dynamically

Open masoom opened this issue 11 years ago • 3 comments

I have a table whose headers(columns) get populated depending on the click of an object. So every time a user clicks on a tree object, there is a different header and cell contents in the table. The data on the grid is populated from a JSON file and is passed to the property of scope as $scope.data = data.

After I integrated UI Grid in my project, The columns headers don't change. How can you set the column headers dynamically based on the user selection?

Here is my fiddle https://jsfiddle.net/svcxh6hu/8/

masoom avatar Mar 21 '15 20:03 masoom

Have you tried the $scope.gridApi.core.notifyDataChange() API? I suppose you'd call that to ask ui-grid to redraw.

paambaati avatar Mar 25 '15 04:03 paambaati

The column headings are changing for me in the jsfiddle. Are you sure they aren't changing for you?

PaulL1 avatar Mar 25 '15 08:03 PaulL1

Further information sought and not provided for 2 weeks, assuming problem has been resolved.

PaulL1 avatar Apr 12 '15 06:04 PaulL1