View Full Version : Ext.data.TreeStore.fillnode error when ajax request failed

14 Oct 2011, 7:25 AM
Sencha Touch version tested:


Platform tested against:

iOS 3.x
iOS 4
Android 2.1
Android 2.2

The function fillnode of Ext.data.TreeStore.fillnode doesn't check if records exists, therefore if json file was not found, it tries to set the variable ln to records.length and you get a javascript typeError
Test Case:
in the kitchensink sample, rename the file carregions.json as wrongfilename.json, this will make a 404 error in the AJAX call, and the TreeStore will not handle it correctly

Steps to reproduce the problem:

use kitchen sink sample
rename carregions.json
The result that was expected:

an empty list in the nested list display
The result that occurs instead:

script error

Possible fix:

in the function fillnode do ln = records?records.length:0