-1

I am not able to use RuleJS (formula support) with setup handsontable + angularjs.

In angular data is loaded but only formula support functionality is not working at all.Same thing is working without angular ( in jquery).

I am not able to use RuleJS (formula support) with setup handsontable + angularjs.

In angular data is loaded but only formula support functionality is not working at all. Same thing is working without angular ( in jquery). I am wondering if Is there any specific file I need to add for angular ?

code

  <hot-table
                        settings="{settings }"
                        rowHeaders="true"
                        minSpareRows="minSpareRows"
                        datarows="data1"
                        height="300"
                        width="700">                            
                    </hot-table>
 <script>
                                var app = angular.module("app", ['ngHandsontable']);
                                app.controller('mainController', function ($scope, $http, $timeout) {
                                    debugger
                                    $scope.data1 = [
                ['=$B$2', "Maserati", "Mazda", "Mercedes", "Mini", "=A$1"],
                [2009, 0, 2941, 4303, 354, 5814],
                [2010, 5, 2905, 2867, '=SUM(A4,2,3)', '=$B1'],
                [2011, 4, 2517, 4822, 552, 6127],
                [2012, '=SUM(A2:A5)', '=SUM(B5,E3)', '=A2/B2', 12, 4151]
                                    ];


                                    $scope.settings = ({
                                        data: data1,
                                        minSpareRows: 1,
                                        colHeaders: true,
                                        rowHeaders: true,
                                        contextMenu: true,
                                        manualColumnResize: true,
                                        formulas: true
                                    });

                                });
                            </script>
  • Could you post some code samples/error message or at least what have you tried so far? This read more like a statement than a question at the moment and this is a Q&A forum. – kachhalimbu May 15 '15 at 11:25
  • Just to confirm, have you declared ng-app and ng-controller somewhere in your app? And also are there any errors on the browser console? – kachhalimbu May 15 '15 at 11:47
  • Yes I have added all angular related things." I can see data in table as well. Only thing not working is formulas. – Atul Chirame May 15 '15 at 11:49
  • What is this `settings="{}"` this is not valid angular code. Also you are nowhere passing any scope data to hot-table element. Generally you would pass something to the directive using angular expression like `data={{data1}}` – kachhalimbu May 15 '15 at 11:49
  • Then it should be `settings="{{settings}}` – kachhalimbu May 15 '15 at 11:50
  • typo error. corrected. – Atul Chirame May 15 '15 at 12:27
  • post a jsfiddle or plnkr demo for your issue. You still seems to be using single curly braces `{}` instead of double curly braces `{{}}` – kachhalimbu May 15 '15 at 12:30

1 Answers1

0

Anyways I created table with different way and started working fine.

 <div id="HTableGrid" handsontable settings="settings">
  • Did you create your own directive or is a ready directive available anywhere? – Hemant Jul 20 '15 at 04:20
  • @Atulcharmie. I did not get what you mean by creating the table in different way. I'm facing the same issue here.Not able to get the sum of two columns using nghandsontable. Can you have a look at my code and see if you can help anything with that? http://stackoverflow.com/questions/32136795/formulas-not-working-in-nghandsontable – Nikhil Bharadwaj Aug 21 '15 at 13:07