The following is the code :
queryTree = SC.Query.local('Tree.Category',
"categoryId = {categoryId}", {
categoryId: this.get('guid'),
orderBy: "name ASC"
});
queryNote = SC.Query.local('Tree.Note',
"categoryId = {categoryId}", {
categoryId: this.get('guid'),
orderBy: "name ASC"
});
var arrayCategory = Tree.store.find(queryTree);
var arrayNote = Tree.store.find(queryNote);
//Concatenate arrayCategory to arrayNote
I want to return a new array of records that appends the results to arrayCategory and arrayNote. I went through the documentation, but there doesn’t seem to be a concatenate function.
I thought I would have to concatenate the two search results. But I fixed the problem this way:
For every record in
Tree.NoteandTree.CategoryI created a field calledisChildand set it asYESin the former andNOin the latter.Further I changed the return value of the function to this:
EDIT : Something’s still wrong. Could someone suggest how should change this?