-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Thanks MDuchemin for your suggestions.
Here in below i am posting my requirements and approach what i have tried. Please provide, how can i solve these issues.
Requirements: I want to create a group model list which will able to render quickly at least 500 rows without pagination and fixed height. i have following 4 functionality with this group model:
Approach: As browser is getting hanged while rendering 500 rows, so i decided the following approach: - If i have more than 100 rows to render in the list group, i will collapse all groups with defering the children. When i expand a particular group, then it's children will render.
Here is the listbox with grouping example, i also try the same with grid. i tried with the group model with AbstractGroupsModel, GroupsModelArray, SimpleGroupsModel implementations. Actually i need an auto-notifiable GroupModel like ListModelList(In case of simple listbox) in any operations(add, edit and delete).
<listbox model="@load(vm.employeeGroupModel)" >
<listhead sizable="true">
<listheader label="Header1" width="20%"></listheader>
<listheader label="Header2" width="20%"></listheader>
...
</listhead>
<template name="model:group">
<listgroup label="@load(each)" open="true"/>
</template>
<template name="model">
<listitem fulfill="self.what.onOpen">
<listcell>
<!-- Each listcell has two componenents, If user click on edit button, the edtable component will display -->
<label visible="@bind(!vm.editMode)" value="@load(each.empId)"></label>
<textbox visible="@bind(vm.editMode)" value="@load(each.empId)"></textbox>
</listcell>
<listcell>
<label visible="@bind(!vm.editMode)" value="@load(each.joiningDate)"></label>
<datebox visible="@bind(vm.editMode)" value="@load(each.joiningDate)"></datebox>
</listcell>
...
</listitem>
</template>
</listbox>
Issues:
private void collapseAll() { List<listitem> items = listbox.getItems(); for (Listitem listitem : items) { if(listitem instanceof Listgroup) { ((Listgroup)listitem).setOpen(false); } } }
private void expandAll() { List<listitem> items = listbox.getItems(); for (Listitem listitem : items) { if(listitem instanceof Listgroup) { ((Listgroup)listitem).setOpen(true); } } }
Hey mangaldaslima,
From experience in IE, this type of approach is just creating difficulty for yourself. Even if you close all other groups, if your current active group hold more than 500 lines, you are back to square one and you have no way to resolve this elegantly. Especially if you need to support large datasets in your list / grid, this should be done with render on demand. With ROD active, you will only render blank cells for listitems located outside of the screen, thus significantly reducing the rendering time in all browsers and very much in IE.
From your example, I don't see any height information on the listbox itself. You mentioned " without pagination and fixed height", does the fixed height part mean that you are trying to scroll the page instead of scrolling inside the listbox?
For ROD to be active, you must scroll inside the listbox (thus, either fixed height, or some type of vflex / height in % to fill in the rest of the available screen space. Have a look here for more details on ROD: https://www.zkoss.org/wiki/ZK%20Developer's%20Reference/Performance%20Tips/Listbox,%20Grid%20and%20Tree%20for%20Huge%20Data/Turn%20on%20Render%20on%20Demand
With ROD, you only render a few lines initially, and then update the page on demand. If your templates are complicated with a lot of entries, then it's definitely the best performance saver for Listbox/Grid. This should solve most of the rendering issue in IE. (even if you don't implement it in the end, it's worth giving it a try just to see the difference).
Asked: 2017-11-01 17:24:26 +0800
Seen: 9 times
Last updated: Nov 02 '17