new module:ct-grid /operation /Column Reordering Operation(policy, configopt)
Tracks a reordering operation within a component. It reorders horizontally arranged columns. Columns are composed of a header and a body. The header is draggable, while both the header and body are proxied and shielded druing the operation.
hint functions are called during the reordering to indicate the planned action. action functions are called when the operation ends to carry out the planned action.
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
policy |
object | Notified of [confirmReorder,isFixed,identifyBody,onReorderStarted,reorderColumn,selectColumn,cancelColumn,scrollHorizontallyTo] |
|||||||||||
config |
object |
<optional> |
tweaks to how the drag works. Which elements can be dragged. Properties
|
Methods
clone Origin Body(elements, configopt)
Use by onReorderStarted
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
elements |
qrray | |||||||||||||||||
config |
object |
<optional> |
clone config Properties
|
clone Origin Header(elements, configopt)
Use by onReorderStarted
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
elements |
qrray | |||||||||||||||||
config |
object |
<optional> |
clone config Properties
|
forget()
Forget any cached information
get Container Element() → {HTMLElement}
Returns:
- Type
- HTMLElement
get Header Bounding Element() → {HTMLElement}
Returns:
- Type
- HTMLElement
get Horizontal Scroll Element() → {HTMLElement}
Returns:
- Type
- HTMLElement
get Shield Border Space()
Returns the border dimensions, along with the top offset. {width,height,top} in pixels of the shield border and top offset.
Returns:
border dimensions
is Reordering() → {boolean}
Returns:
Is a reordering operation in progress
- Type
- boolean
is Snapping() → {boolean}
Returns:
Is a snapping operation in progress
- Type
- boolean
move Column(event) → {boolean}
Attempt to start a column move. Call this method in a mousedown event handler. It will start the operation if appropriate.
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent | Event passed from the mousedown event handler. |
Returns:
true if a column move has started
- Type
- boolean
recalc Columns()
Recalculate column information from the DOM Elements. Call if the columns are visually changed by something other than the operation.
Precalc is currently disabled. All calculations are done during mouse down, so this function is of limited use.
set Container Element(eContainer)
Container element within which the operation takes place. Shield and clone elements are added as children of this. This must be set. The operation is assumed to happen on columns within the same container.
Parameters:
Name | Type | Description |
---|---|---|
eContainer |
DOMElement |
set Header Bounding Element(eBounding)
Restrict the draggable elements to be descendants of a single ancestor. This must be an ancestor common to all headers
Parameters:
Name | Type | Description |
---|---|---|
eBounding |
DOMElement | Common header ancestor |
set Horizontal Scroll Element(eScroll)
Set the element that contains the horizontal scroll bar. This can be the same as the container or a separate element. The widths and scroll offset of this element will be used to adjust for and control scrolling
Parameters:
Name | Type | Description |
---|---|---|
eScroll |
DOMElement | Element containing the scroll bar. |
set Proxy Style(styles)
Use in onReorderStarted callback
Parameters:
Name | Type | Description |
---|---|---|
styles |
object | Map of style name & value |
set Shield Style(styles)
Use in onReorderStarted callback
Parameters:
Name | Type | Description |
---|---|---|
styles |
object | Map of style name & value |
track Clone(nDiff, bHappy Scroll)
Update proxy of column to left offset
Parameters:
Name | Type | Description |
---|---|---|
nDiff |
int | Movement in pixels from origin |
bHappyScroll |
boolean |
start scrolling when touching edge, rather than when 10 pixels past edge StartOperation and mouse move causes trackClone normal Snapping causes trackClone with happy scroll |
update Proxy Body Height()
Give the proxy body the remaining height.