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

dojox/grid/enhanced/_Plugin

Summary

The typical pagination way to deal with huge dataset an alternative for the default virtual scrolling manner.

Usage

var foo = new Pagination(inGrid,option);
dojox/grid/enhanced/_Plugin
Parameter Type Description
inGrid dojox/grid/EnhancedGrid

The grid to plug in to.

option undefined

Property Summary

  • _connectsList of all connections.
  • _currentPage
  • _currentPageSize
  • _defaultRowsPerPage
  • _maxSize
  • _nls
  • _showAll
  • _subscribesList of all subscribes.
  • defaultPageWhich page will be displayed initially, 1st page by default.
  • defaultPageSizeNumber of rows in a page, 25 by default.
  • descriptionWhether the description information will be displayed, true by default.
  • gotoButtonWhether the goto page button will be displayed, false by default.
  • gridGrid that the plugin belongs to
  • maxPageStepThe max number of page sizes to be displayed, 7 by default.
  • name
  • optionPlugin properties - leveraged with default and user specified properties. e.g. for dnd plugin, it may look like {"class": dojox.grid.enhanced.plugins.DnD, "dependency": ["nestedSorting"], ...}
  • pageSizesArray of page sizes for switching, e.g. [10, 25, 50, 100, Infinity] by default, Infinity or any NaN value will be treated as "all".
  • pageStepperWhether the page switch options will be displayed, true by default.
  • positionThe position of the pagination bar - "top"|"bottom", "bottom" by default.
  • privatesPrivate properties/methods shouldn't be mixin-ed anytime.
  • sizeSwitchWhether the page size switch options will be displayed, true by default.

Method Summary

Event Summary

Properties

_connects

List of all connections.

_currentPage
_currentPageSize
_defaultRowsPerPage
_subscribes

List of all subscribes.

defaultPage

Which page will be displayed initially, 1st page by default.

defaultPageSize

Number of rows in a page, 25 by default.

description

Whether the description information will be displayed, true by default.

gotoButton

Whether the goto page button will be displayed, false by default.

grid

Grid that the plugin belongs to

maxPageStep

The max number of page sizes to be displayed, 7 by default.

option

Plugin properties - leveraged with default and user specified properties. e.g. for dnd plugin, it may look like {"class": dojox.grid.enhanced.plugins.DnD, "dependency": ["nestedSorting"], ...}

pageSizes

Array of page sizes for switching, e.g. [10, 25, 50, 100, Infinity] by default, Infinity or any NaN value will be treated as "all".

pageStepper

Whether the page switch options will be displayed, true by default.

position

The position of the pagination bar - "top"|"bottom", "bottom" by default.

privates

Private properties/methods shouldn't be mixin-ed anytime.

sizeSwitch

Whether the page size switch options will be displayed, true by default.

Methods

_initOptions()
changePageSize(size)
Parameter Type Description
size undefined
connect(obj,event,method)

Connects specified obj/event to specified method of this object.

Parameter Type Description
obj undefined
event undefined
method undefined
Returns:undefined

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when foo.bar() is called, call the listener in the scope of plugin
plugin.connect(foo, "bar", function(){
    console.debug(this.xxx());//"this" - plugin scope
});
currentPage(page)

Shift to the given page, return current page number. If there is no valid page was passed in, just return current page num.

Parameter Type Description
page Integer

The page to go to, starting at 1.

Returns:any | Integer

Current page number

currentPageSize(size)

Change the size of current page or return the current page size.

Parameter Type Description
size Integer | null

An integer identifying the number of rows per page. If the size is an Infinity, all rows will be displayed; if an invalid value passed in, the current page size will be returned.

Returns:any | Integer|null

Current size of items per page.

disconnect(handle)

Disconnects handle and removes it from connection list.

Parameter Type Description
handle undefined
firstPage()

Go to the first page

getTotalPageNum()

Get total page number

Returns:undefined
getTotalRowCount()

Function for get total row count

Returns:undefined
gotoFirstPage()
gotoLastPage()
gotoPage(page)
Parameter Type Description
page undefined
lastPage()

Go to the last page

nextPage()

Go to the next page.

prevPage()

Go to the previous page.

removeSelectedRows()
scrollToRow(inRowIndex)

Override the grid.scrollToRow(), could jump to the right page and scroll to the specific row

Parameter Type Description
inRowIndex integer

The row index

Returns:undefined
showGotoPageButton(flag)

For show/hide the go to page button dynamically

Parameter Type Description
flag boolean

Show the go to page button when flag is true, otherwise hide it

subscribe(topic,method)

Subscribes to the specified topic and calls the specified method of this object.

Parameter Type Description
topic undefined
method undefined
Returns:undefined

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
unsubscribe(handle)

Un-subscribes handle and removes it from subscriptions list.

Parameter Type Description
handle undefined

Events

_onDelete()

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
_onNew(item,parentInfo)
Parameter Type Description
item undefined
parentInfo undefined

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
onPostInit()

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
onPreInit()

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
onSetStore(store)

Called when store is changed.

Parameter Type Description
store undefined

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
onStartUp()

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
Error in the documentation? Can’t find what you are looking for? Let us know!