How to assign a handsontable grid to the window object and how to use it

时间:2015-08-06 07:43:33

标签: javascript handsontable

I want to use the window to access my handsontable grid and change some things with the associated functions in an ajax callback function. I'm trying to use the window.variable (with the advice of ZekeDroid) to use a handsontable instance in an ajax callback function. When I run my code, firebug tells me that the variable is undefined.

So I declared my handsontable like that :

window.hotTraitement = new Handsontable(container, {
  data: data_traitement,
  stretchH: 'all',
  minSpareRows: 1,
  observeChanges : true,
  rowHeaders: false,

And I'm trying to use it like that :

window.hotTraitemenT.setDataAtCell(1,0,'bonjour');

I don't know how to use the window instances, it's the first time but if there is an other solution, I take it too !

0 个答案:

没有答案