how to know dataview already loaded?load method is async.second run load method,datacount=0.
my code:
goods = new dhtmlXDataView({
container: “goods_container”,
type: {
template:“
template_loading: “loading…”,
width:71,
height:50,
margin: 0,
padding: 0
},
x_count: 5,
y_count: 5
});
goods.define(“select”,true);
goods.load(encodeURI(“get_goods_json.asp?&etc=” + new Date().valueOf()),“json”);
function update1(){
goods.clearAll();
goods.load(encodeURI(“get_goods_json.asp?&etc=” + new Date().valueOf()),“json”,update2())
}
function update2(){
alert(goods.dataCount());
//return value: goods.dataCount=0
//why? })