{"action":"created","issue":{"url":"https://api.github.com/repos/handsontable/handsontable/issues/3057","labels_url":"https://api.github.com/repos/handsontable/handsontable/issues/3057/labels{/name}","comments_url":"https://api.github.com/repos/handsontable/handsontable/issues/3057/comments","events_url":"https://api.github.com/repos/handsontable/handsontable/issues/3057/events","html_url":"https://github.com/handsontable/handsontable/issues/3057","id":121439450,"number":3057,"title":"CountRows() return nothing but Undefined !","user":{"login":"max223","id":16225544,"avatar_url":"https://avatars.githubusercontent.com/u/16225544?v=3","gravatar_id":"","url":"https://api.github.com/users/max223","html_url":"https://github.com/max223","followers_url":"https://api.github.com/users/max223/followers","following_url":"https://api.github.com/users/max223/following{/other_user}","gists_url":"https://api.github.com/users/max223/gists{/gist_id}","starred_url":"https://api.github.com/users/max223/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max223/subscriptions","organizations_url":"https://api.github.com/users/max223/orgs","repos_url":"https://api.github.com/users/max223/repos","events_url":"https://api.github.com/users/max223/events{/privacy}","received_events_url":"https://api.github.com/users/max223/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/handsontable/handsontable/labels/Demo%20needed","name":"Demo needed","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-10T09:33:01Z","updated_at":"2015-12-11T09:52:08Z","closed_at":null,"body":"Hello everyone :) Thank's for your time,reading my issue. \r\nI'm using the handsontable library since a week and i have some troubles using a couples of methods.\r\n\r\nI have the following code in a function :\r\n\r\n    count = $('#tableur').handsontable('countRows');\r\nIt appears that count = \"undefined\" when i try to print it.\r\n\r\n\r\nMy handsontable is build this way :\r\n\r\n    var container1 = document.getElementById('tableur');\r\n\r\n    var settings1 = {\r\n    data: mydata,\r\n    // colHeaders: Headers,\r\n    minRows: 28,\r\n    minCols: 10,\r\n    rowHeights: 40,\r\n    colWidths: 110,\r\n    formulas: true,\r\n    cells: function(row, col, prop) {\r\n      var cellProperties = {};\r\n      if ((~rowBigPhase.indexOf(row)) || row === 0) {\r\n        cellProperties.renderer = bigPhasesRender;\r\n      }\r\n      return cellProperties;\r\n    },\r\n    columns: columns\r\n    };\r\n\r\n    var hot1 = new Handsontable(container1, settings1);\r\n\r\nI did'nt include in the code the var Headers,mydata,columns, and the part when i get the data  via ajax or the updateSetting and the context menu, because it's useleless of course. But if you need the all code i can give it to you.\r\n\r\nSomeone on stackoverflow told me to do the counting in an after change function, i tried to do this :\r\nthx for your answer ! Unfortunately, it didnt work, i tried to do this : \r\n\r\n      var afterChange = function(change,source) {\r\n      count = $('#tableur').handsontable('countRows');\r\n      str1 = \"=SUM(E2:E\"+count+\")\";\r\n      str2 = \"=SUM(H2:H\"+count+\")\";\r\n      Headers[4] = str1;\r\n      Headers[7] = str2;\r\n      alert(count);\r\n     }\r\n\r\nOr even this :\r\n\r\n     var afterChange = function(change,source) {\r\n     do_Ajax();\r\n     }\r\n\r\n    \r\n    count = $('#tableur').handsontable('countRows');\r\n    alert(count);\r\n\r\nAnd i always getting a \r\n> Undefined\r\n\r\nfor the return of countRows. Starting to desperate, if i didnt do the afterChange properly can you please explain it to me ? i have read the docs ! \r\n\r\nThanks much again, if anyone can help me i will be thankfull :)\r\n\r\n**EDIT : **\r\nHere is the fiddle :) http://jsfiddle.net/1uqztjmm/6/ :tada:\r\n\r\nThanks again for the support @AMBudnik\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/handsontable/handsontable/issues/comments/163893125","html_url":"https://github.com/handsontable/handsontable/issues/3057#issuecomment-163893125","issue_url":"https://api.github.com/repos/handsontable/handsontable/issues/3057","id":163893125,"user":{"login":"budnix","id":571316,"avatar_url":"https://avatars.githubusercontent.com/u/571316?v=3","gravatar_id":"","url":"https://api.github.com/users/budnix","html_url":"https://github.com/budnix","followers_url":"https://api.github.com/users/budnix/followers","following_url":"https://api.github.com/users/budnix/following{/other_user}","gists_url":"https://api.github.com/users/budnix/gists{/gist_id}","starred_url":"https://api.github.com/users/budnix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/budnix/subscriptions","organizations_url":"https://api.github.com/users/budnix/orgs","repos_url":"https://api.github.com/users/budnix/repos","events_url":"https://api.github.com/users/budnix/events{/privacy}","received_events_url":"https://api.github.com/users/budnix/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T09:52:08Z","updated_at":"2015-12-11T09:52:08Z","body":"Updated demo http://jsfiddle.net/1uqztjmm/9/. `updateSettings` now working."}}