sqlite - Unable to set values in javascript array -


i unable set project activities inside clientsdata. here scenario

by time control reaches inside callback function of executesql, values of , j maximum possible values because executesql() asynchronous function. when try execute following line

clientdata[i].projects[j].activities = result.rows; 

it gives me error saying "cannot read property 'projects' of undefined"

code snippet

    (var = 0; < clientdata.length; i++) {         (var j = 0; j < clientdata[i].projects.length; j++) {             var getactivities = "select * activity \n\                                 activityid \n\                                 in \n\                     (" + clientdata[i].projects[j].activityids + ")";             tx.executesql(getactivities, [], function (tx, result) {                 clientdata[i].projects[j].activities = result.rows;                 updateclientdata(clientdata);             });         }     } 


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -