dojox/grid/enhanced/plugins/_SelectionPreserver (version 1.10)

dojox/grid/_SelectionPreserver

Summary

Preserve selections across various user actions.

Extends dojox.grid._SelectionPreserver adding a bit more support to make selection persistence working well with various EnhancedGrid features, e.g. filtering, nested sorting, pagination, select all etc.

Precondition - Identifier(id) is required for store, as id is used for differentiating row items. Known issue - The preserved selections might be inaccurate if some unloaded rows are previously selected by range(e.g.SHIFT + click)

Usage

var foo = new _SelectionPreserver(selection);
dojox/grid/enhanced/plugins/_SelectionPreserver
Parameter Type Description
selection undefined

Examples

Example 1

//To turn on this - set 'keepSelection' attribute to true
<div dojoType="dojox.grid.EnhancedGrid" keepSelection = true .../>

Method Summary

  • _reSelectById(item,index) Overwritten
  • _selectById(toSelect,inItemOrIndex) Overwritten
  • _updateMapping(trustSelection,isSelect,isForAll,from,to) This function try to keep the selection info updated when range selection is performed.
  • destroy()
  • reset()

Event Summary

Methods

_reSelectById(item,index)

Overwritten

Parameter Type Description
item undefined
index undefined
_selectById(toSelect,inItemOrIndex)

Overwritten

Parameter Type Description
toSelect undefined
inItemOrIndex undefined
_updateMapping(trustSelection,isSelect,isForAll,from,to)

This function try to keep the selection info updated when range selection is performed.

  1. Calculate how many unloaded rows are there;
  2. update _selectedById data if grid.selection._selected can be trusted, so loaded but unselected rows can be properly recorded.
Parameter Type Description
trustSelection undefined
isSelect undefined
isForAll undefined
from undefined
to undefined

Events

onSelectedById(id,rowIndex,value)
Parameter Type Description
id undefined
rowIndex undefined
value undefined

Examples

Example 1

//To turn on this - set 'keepSelection' attribute to true
<div dojoType="dojox.grid.EnhancedGrid" keepSelection = true .../>
Error in the documentation? Can’t find what you are looking for? Let us know!