You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.
Checking the console the first thing that pops out is noOfResults: undefined. Is there way to get the actual value of noOfResults ?
I've also tried to set up dataTable with success and fail functions but I can't access the value of dataTable.getNumberOfRows() outside of the success function.
Is there any fix to this problem ? Or has somebody found a workaround ?
The text was updated successfully, but these errors were encountered:
I have cleaned up the code surrounding the noOfResults variable in the develop branch.
However, the log(A) in your code is very likely to always say that noOfResults is undefined as this line is likely to be called before the results are retrieved. (So noOfResults should really be removed.)
This is an example of working with the dataTable asynchronously: A.getDataTable(function(x) { alert(x.getNumberOfRows());});
The x is the dataTable, and the function gets called on the dataTable once it is ready.
I have cleaned up the code surrounding the noOfResults variable in the develop branch.
However, the log(A) in your code is very likely to always say that noOfResults is undefined as this line is likely to be called before the results are retrieved. (So noOfResults should really be removed.)
This is an example of working with the dataTable asynchronously:
A.getDataTable(function(x) { alert(x.getNumberOfRows());});
The x is the dataTable, and the function gets called on the dataTable once it is ready.
Thank you @mgskjaeveland your suggestion fixes the problem.
I'm using sgVizler in Reactjs and the only thing that you'd need to add to the function in order to have access to value of x outside of the function or to change some states inside of the function(x) is to bind the function like this A.getDataTable(function(x) { alert(x.getNumberOfRows());}.bind(this));
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Whenever I try to get query results before displaying them I either get errors or undefined values.
My code
//Initialize new Query
var A = new sgvizler.Query();
Checking the console the first thing that pops out is
noOfResults: undefined
. Is there way to get the actual value ofnoOfResults
?I've also tried to set up dataTable with
success
andfail
functions but I can't access the value ofdataTable.getNumberOfRows()
outside of thesuccess
function.Is there any fix to this problem ? Or has somebody found a workaround ?
The text was updated successfully, but these errors were encountered: