* Isomorphic SmartClient
* Version v9.0p_2013-08-19 (2013-08-19)
* All browsers.
Problem: ListGrid's grouping state is lost when it gets updated by calling setTestData() on the DataSource and invalidateCache() on the grid. Example: collapse group1 and expand group2, grid refreshes, all groups come back open.
What I've tried
(1) Using ListGrid.getGroupState() and then calling ListGrid.setGroupState()
(2) Digging the tree information from the group record and then collapsing/expanding groups based on a state previously saved. Bad idea: the grid blinks before the groups are fixed and causes an annoying experience to the user.
(3) Taking out groupStartOpen, but no effect.
Any suggestions? I'll be sharing some snippets too.
ListGrid
DataSource
* Version v9.0p_2013-08-19 (2013-08-19)
* All browsers.
Problem: ListGrid's grouping state is lost when it gets updated by calling setTestData() on the DataSource and invalidateCache() on the grid. Example: collapse group1 and expand group2, grid refreshes, all groups come back open.
What I've tried
(1) Using ListGrid.getGroupState() and then calling ListGrid.setGroupState()
(2) Digging the tree information from the group record and then collapsing/expanding groups based on a state previously saved. Bad idea: the grid blinks before the groups are fixed and causes an annoying experience to the user.
(3) Taking out groupStartOpen, but no effect.
Any suggestions? I'll be sharing some snippets too.
ListGrid
Code:
isc.ListGrid.create({ ID: "queueStatusList", width: "100%", height: "100%", headerHeight: 30, cellHeight: 25, dataSource: getQueueStatusPanelDataSource(), groupByField: "directionType", // groupStartOpen: "all", sortField: "longest", sortDirection: "ascending", recordEnabledProperty: "enabled", quickDrawAheadRatio: 4.0, wrapCells: true, fixedRecordHeights: false, autoFetchData: true, canResizeFields: false, canAutoFitFields: false, canReorderFields: false, alternateRecordStyles: true, virtualScrolling: false, showHeaderContextMenu: false, groupByAsyncThreshold: 100 });
Code:
isc.DataSource.create({ ID: "queueStatusPanelDataSource", clientOnly: true, testData: getQueueData("all_queues"), fields:[{ name: "statusFlag", headerTitle: "", width: 15, align: "center", type: "image", imageURLPrefix: CONFIG.AGUI_IMG_PATH, imageURLSuffix: ".png", imageSize: 10, prompt: CONFIG.PROMPT.memberOf, icon: CONFIG.AGUI_IMG_PATH + "agent_info_member_of.png", iconSize: 10, canEdit: false, canFilter: false }, { name: "enabled", showIf: "false" }, { name: "supervisorOf", showIf: "false" }, { name: "name", title: "Queue", type: "text", width: nameWidth }, { name: "busy", headerTitle: "", type: "text", align: "center", showIf: busyShowIf, prompt: CONFIG.PROMPT.busyInteractions, icon: CONFIG.AGUI_IMG_PATH + "agent_info_busy_agent.png", iconSize: 16, width: 26 }, { name: "wait", headerTitle: "", type: "text", align: "center", showIf: waitShowIf, prompt: CONFIG.PROMPT.inQueueInteractions, icon: CONFIG.AGUI_IMG_PATH + "agent_info_waiting.png", iconSize: 16, width: 26, formatCellValue: formatQueueStatusCellValue }, { name: "longest", headerTitle: "", type: "text", align: "center", icon: CONFIG.AGUI_IMG_PATH + "agent_info_duration.png", iconHeight: 16, iconWidth: 16, prompt: CONFIG.PROMPT.longestWaiting, canSort: true, width: 52 }, { name: "lastInteraction", title: CONFIG.LAST + "<br>" + CONFIG.CONTACTED, type: "datetime", showIf: lastInteractionShowIf, align: "right", datetimeFormatter: "toLocaleString", width: 68 },{ name: "directionType", type: "text", showIf: "false", valueMap: directionTypeValueMap },{ name: "favIconField", headerTitle: "", align: "center", type: "image", width: 25, emptyCellValue: "", icon: CONFIG.AGUI_IMG_PATH + "agent_info_fav_on.png", iconSize: 16, prompt: CONFIG.PROMPT.favorites, imageURLPrefix: CONFIG.AGUI_IMG_PATH, imageURLSuffix: ".png", imageSize: 16, formatCellValue: formatQueuesFavIconField }] });
Comment