Login Register

hierarchy

Retrieve parentNode chain

I've been trying to get a NodeList from a parentNode chain array with the following code:

dojo.NodeList().adopt(getAncestry(searchNode))
…
function getAncestry(startNode){
	var arr = [];
	var n = startNode;
	while(n = n.parentNode){
		if(n.nodeName == 'BODY')break;
		arr.push(n);
	}
	return arr;
}

…but get a result of a NodeList which contains the ancestry node array in its first index. Ex:


dojo.NodeList().adopt(getAncestry(searchNode).forEach(function(item){
console.log("item : " + item)
})

Grid & ItemFileReadStore - Using modified JSON format

Hello,

I am currently in the process of trying to implement a grid using a JSON store. I have successfully done this with a JSON file that followed the ItemFileReadStore.js requirements of using an items array. I have recently been trying to figure out how best to use a custom JSON store hierarchy with my grid. The store looks like the following:


{
"top": [
{"id":1, "name": "Name1", "width":2,
"first":[
{"card":1, "circuit":7},
{"card":1, "circuit":8}

Syndicate content