List load json data does not work if I place a callback function, but xml works fine

I try the List sample:
http://127.0.0.1:8015/samples/dhtmlxList/03_loading/02_load_json.html
and place a callback function in the loading method as follow:

Loading data from JSON file p{ font-size:14px; margin: 0.3em; }

Loading JSON data from file

it does not work, but I try another sample that loading the xml file, it works fine:

Loading data from XML file function doOnLoad() { myList = new dhtmlXList({ container:"data_container", template:"#name##address#
#city#", type:{ height:"auto" } }); // I edited the code here myList.load("../common/list.xml",function(text){ alert(text);
		},"xml");
	}
</script>
<style type="text/css">
p{
	font-size:14px;
	margin: 0.3em;
}
</style>

Loading XML data from file

why? is that a bug here?

I apologize, the correct format is:

	myList.load("../common/list.json", "json",function(text){ alert(text);});

We’ll fix the the documentation as soon as possible.

1 Like

Hi, sematik
Thank you very much!