Monday, 26 August 2013

jaydata not working in related data storage

jaydata not working in related data storage

i am new to jaydata and just learned through many tutorials and examples
how to define model and store data using JayData. i have written a code
which would store data on local storage and it has two entities with one
to many relation with each other. i have checked my code many times and
also compared it with the available example codes and it is right code but
it is not working. the problem is that when i push the single entity into
the array which is defined in the other entity model, it does not save the
changes and if i comment that push line, everything works fine. i have
created a jsfiddle and i have commented that line in my js code
the code is like this
var task_entity = new Tsk({Task_work:tsk });
mydb.tasks.add(task_entity);
var category_entity=new Categry({Name:ctgry});
category_entity.taskk=new Array();
//category_entity.taskk.push(task_entity); // this line is not working
mydb.categorys.add(category_entity);
i have commented the line that is creating problem
here is the jsfiddle http://jsfiddle.net/zGqyZ/1/
please let me know what is wrong with the code or may be with the jaydata
model, i can't find the main problem
Thanks a lot

No comments:

Post a Comment