AngularJS: Unable to use `Formulas` in handsontable

103 views Asked by At

I am using handsontable to preview my data from the json, its showing my data very well but now when i am trying to use formulas in my table grid its not working. Means whenever i am typing =SUM(1+1) its should show result 2 in column but its just showing =SUM(1+1) as its is. Its not implementing formula even bower inject rule.js file in my project.

My HTML Code:

<md-content class="content" >
   <hot-table settings="{formulas: true, colHeaders: columnsData, stretchH: 'all',filters: true,dropdownMenu: true,manualColumnMove: true, contextMenu: ['row_above', 'row_below', 'remove_row','---------','col_left','col_right','remove_col','---------','undo','redo','---------','make_read_only','alignment'], afterChange: afterChange}"
                       row-headers="false"
                       min-spare-rows="minSpareRows"
                       datarows="vm.items"
                       height="500"
                       width="1255">
         <hot-column data='{{key}}' title="key" type="grayedOut"  ng-repeat="(key, item) in vm.items[0]"></hot-column>
   </hot-table>
</md-content>

My Controller Code:

api.dataset.getById.get({'id': $state.params.id},
    // Success
    function (response){
        console.log(JSON.stringify(response.records.records));
      vm.items = response.records.records;
      vm.dataset_id = response.records.dataset_id;
    },
    // Error
    function (response){
      console.error(response);
    }
  );

Items JSON:

[
  {
    "employee_id": 110011,
    "employee_name": "Rahul Sharma",
    "department": "PHP",
    "position": "Junior",
    "salary": 10000,
    "company": "oxo"
  },
  {
    "employee_id": 110012,
    "employee_name": "Gobind Rai",
    "department": "PHP",
    "position": "Senior",
    "salary": 10000,
    "company": "oxo"
  },
  {
    "employee_id": 110013,
    "employee_name": "Sandeep Singh",
    "department": "PHP",
    "position": "Fresher",
    "salary": 5000,
    "company": "oxo"
  },
  {
    "employee_id": 110014,
    "employee_name": "Ashish",
    "department": "PHP",
    "position": "Junior",
    "salary": 20000,
    "company": "oxo"
  },
  {
    "employee_id": 110015,
    "employee_name": "Pawan",
    "department": "PHP",
    "position": "Senior",
    "salary": 10000,
    "company": "oxo"
  }
]

Example

enter image description here

I have tried every thing related to this but unable to use formulas.

0

There are 0 answers