gridx
Legend: Array Boolean Constructor Date DomNode Error Function Namespace Number Object RegExp Singleton String

gridx.core.model.extensions.Move

Object » _Extension » gridx.core.model.extensions.Move
dojo.require("gridx.core.model.extensions.Move");
Defined in gridx/core/model/extensions/Move.js

Property Summary

Method Summary

  • _cmdMove()
  • clear()
  • constructor(model, args)
  • insert(dataArray, prevItem, nextItem)
  • move(start, count, target)
  • moveIndexes(indexes, target)
  • updateStore(finishDef, moves, map) Do the actual moving work here, that is to change the moveField of moved rows. User can overwrite this function to provide customized logic. Here a default implementation is provided. This implementation requires the moveField is a field of number type, and it can accept any number. In other words, this moveField is just a field to indicate row order without any other meanings. This default implementation tries to reduce the overall requests sent to store, because the current store implementation sends a separate PUT command to store for every single item one by one. Note: this is more like a public attribute rather than a public method, because users should assign a value to is rather can directly call it.

Attached Objects

Properties

model
Overrides _Extension

Methods

_cmdMove
Overrides _Extension
clear
Overrides _Extension
constructor
Overrides _Extension
ParameterTypeDescription
model
args
insert
Overrides _Extension
ParameterTypeDescription
dataArray
prevItem
nextItem
move
Overrides _Extension
ParameterTypeDescription
start
count
target
moveIndexes
Overrides _Extension
ParameterTypeDescription
indexes
target
updateStore
Overrides _Extension
Do the actual moving work here, that is to change the moveField of moved rows. User can overwrite this function to provide customized logic. Here a default implementation is provided. This implementation requires the moveField is a field of number type, and it can accept any number. In other words, this moveField is just a field to indicate row order without any other meanings. This default implementation tries to reduce the overall requests sent to store, because the current store implementation sends a separate PUT command to store for every single item one by one. Note: this is more like a public attribute rather than a public method, because users should assign a value to is rather can directly call it.
ParameterTypeDescription
finishDefdojo.DeferredA Deferred object to indicate when the update is finished. finishDef.callback() or finishDef.errback() must be called in this function, otherwise the grid will break.
movesArrayThis is an array of arrays. Each element is an array of 3 numbers: startIndex, rowCount, targetIndex. These numbers represents a single movement operation, which has the following semantic: "rowCount" rows from index "startIndex" are moved to index "targetIndex" These movement operations take place in the given order, so the index in later movement is different from those in the previous movement, since it is based on the result of the previous movement.
mapAssociationarray An index mapping from the original indexes to the new indexes. This map is generated from the "moves" argument, so it has exactly the same information as "moves". But it is pre-processed to reflect the final index mapping after all these movements are done, so it might be easier to use.