I am using handsonetable with angularjs and I want to add a new row by clicking an add button. Is it possible to create dynamic rows in Handsontable grid? and how to do it?
Asked
Active
Viewed 2,321 times
2 Answers
0
I've use following code in my project is work well.
<label>Filter:
<input type="text" ng-model="query">
</label>
<hot-table datarows="results|filter:query">

zhulinpinyu
- 599
- 7
- 12
-1
Have you looked at ngHandsontable? That will make it easy, you can configure it to use a model on the scope for rows, and handsontable will take care of the rest.

David Williams
- 229
- 2
- 10
-
Yes, I am using ngHandsometable and trying to add new row using alter method. But its not working. – Ravindra K Feb 04 '15 at 07:58
-
You shouldn't need to call into HOT directly for this. If it's initialised with `
` then you can just manipulate `$scope.items` and ngHandsontable will update the table accordingly. – David Williams Feb 04 '15 at 08:15 -
Actually I am having bootstrap modal popup and trying to add checked values into ngHandsontable row. So is it possible through $scope.items? – Ravindra K Feb 04 '15 at 09:05
-
As long as you are updating `items` on the same scope your handsontable is on, it should work. This would involve a promise, a callback or a shared service to work with the angular UI modal. – David Williams Feb 05 '15 at 01:31