Hi,
I have a unitlist in my phonegap mobile application,once application loaded I am querying data from sqlite database and defining data to the unitlist by “define” method.But rendering data to the view is taking more time and it is affecting my application performance.Can anyone please help me out to reduce the view loading time?
How many records do you want to show in the unitlist ?
Are you adding all records at once ( by a single js command ) or one by one ?
Adding all records at once will be faster then adding records one by one
//fast
list.parse([ array of objects ]);
//slow
for (each item)
list.add(item)
thanks Maksim, I have to load around 5000 number of records to unitlist and I am adding all records at one stretch by using “define()” method.Is there any difference between define() and parse() method in loading time point of view?
There is no major difference between parse
and define
. Problem in your case is caused by the number of elements. I expect that unit list of such size will render up to few seconds.
I think you can use a different ui instead of unit list, something like next for example
http://webix.com/snippet/f0a1dda8
where the left part is the same part as unit
in the unit list and right part contains the unit related data.
thanks Maksim, now I am facing a new issue like if the number of records are less and defining the data to the unitlist view I am getting ERROR : “$$(viewId) undefined”,that is before loading the view data is getting loaded to the view.Is there any way to check whether the view is loaded or not, so that I can define data to the view after the view get loaded.