$.getJson() 関数を使用して、別の json ファイルにある配列を返し、それをローカル配列 var に格納しています。私が抱えている問題は、json から合計 25 個のアイテムのうち 20 個しか返されないことです。$.getJson には、返されるアイテムの数に制限がありますか?
これは私がコードを使用している方法です:
Javascript:
$.getJSON('data/gridData1.json',function(json){
console.log("Json length is: " + json.length);
var grid = json;
filterGrid(grid, ele);
});
ジョンソン:
[
{"assignment":"Tom" , "cell":["Tom", "2013-10-06", "Client 3", "Activity", "Scheduled" ]}
,{"assignment":"Tom" , "cell":["Tom", "2007-10-06", "Client 2", "Alert" , "Work In Progress" ]}
,{"assignment":"Tom" , "cell":["Tom", "2013-10-06", "Client 3", "Activity", "In Progress" ]}
,{"assignment":"Tom" , "cell":["Tom", "2007-10-06", "Client 1", "Lead" , "Qualified" ]}
,{"assignment":"Tom" , "cell":["Tom", "2007-10-06", "Client 2", "Alert" , "Open" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-06", "Client 1", "Notification" , "New" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-06", "Client 3", "Lead" , "Qualified" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-05", "Client 2", "Lead" , "Unqualified" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-05", "Client 1", "Activity" , "In Progress" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-05", "Client 3", "Lead" , "Qualified" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-04", "Client 3", "Lead" , "Unqualified" ]}
,{"assignment":"Katie" , "cell":["Katie", "2007-10-06", "Client 2", "Activity" , "Draft" ]}
,{"assignment":"Katie" , "cell":["Katie", "2007-10-06", "Client 1", "Activity" , "Draft" ]}
,{"assignment":"Katie" , "cell":["Katie", "2007-10-06", "Client 2", "Activity" , "In Progress" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-06", "Client 1", "Activity" , "Scheduled" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-06", "Client 3", "Activity" , "Scheduled" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-05", "Client 2", "Activity" , "In Progress" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-05", "Client 1", "Alert" , "Work In Progress" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-05", "Client 3", "Alert" , "Open" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-04", "Client 3", "Notification" , "New" ]}
,{"assignment":"Hank" , "cell":["Hank", "2013-10-06", "Client 3", "Lead", "Unqualified" ]}
,{"assignment":"Hank" , "cell":["Hank", "2007-10-06", "Client 2", "Alert" , "Work In Progress" ]}
,{"assignment":"Hank" , "cell":["Hank", "2007-10-06", "Client 1", "Lead" , "Qualified" ]}
,{"assignment":"Hank" , "cell":["Hank", "2007-10-06", "Client 2", "Alert" , "Open" ]}
,{"assignment":"Mike" , "cell":["Mike" , "2007-10-04", "Client 3", "Notification" , "New" ]}
]
コンソール ログに次の結果が表示されます。