How to load data dynamically?
Dynamic loading is based on the method loadNext(). The method is applied to all components operated on data (e.g. list).
loadNext(num, pos) - loads the specified number of records started from the certain position.
There are 2 scenarios you can use while dynamic loading:
dhx.ui( { view:"list", id:"mylist", url:"books.php", datatype:"json", template:"#title# (#author#)"}, { view:"button", label:" show 20 more", click:"next"} ) function next(){ $$('mylist').loadNext(20); }
Related sample: 04_list/14_dyn_loading.html
dhx.ui( { view:"list", id:"mylist", url:"books.php", datatype:"json", template:"#title# (#author#)"}, { view:"button", label:" show 20 more", click:"next"} ) var page = 1; function next(){ page++; $$('mylist').clearAll(); $$('mylist').loadNext(20, (page-1)*20); }
Related sample: 04_list/14_page_loading.html