54
Name
Parameters
Description
their names.
namePart? (string): Name of the part to be named
after the host element. This determines how the
control submits data when used in forms.
binding the template parts to the
corresponding control members.
For example, the code below applies a
template to an instance of
an InputNumber control. The template must
ust
contain elements with the 'wj-part' attribute
e
set to 'input', 'btn-inc', and 'btn-dec'. The
he
control members '_tbx', '_btnUp', and '_btnDn'
will be assigned references to these elements.
this.applyTemplate('wj-control wj-inputnumber',
',
template, {
_tbx: 'input',
_btnUp: 'btn-inc',
_btnDn: 'btn-dec'
}, 'input');
(inherited from Control).
.
autoSizeColumn(c,
header?, extra?)
c (number): Index of the column to resize.
header? (boolean): Whether the column index refers
to a regular or a header row.
(default value: false)
extra? (number): Extra spacing, in pixels.
(default value: 4)
Resizes a column to fit its content.
(inherited from FlexGrid).
autoSizeColumns
(firstColumn?, lastColumn?,
header?, extra?)
firstColumn? (number): Index of the first column to
resize (defaults to the first column).
lastColumn? (number): Index of the last column to
resize (defaults to the last column).
header? (boolean): Whether the column indices refer
to regular or header columns.
(default value: false)
Resizes a range of columns to fit their
content.
The grid will always measure all rows in the
current view range, plus up to 2,000 rows not
currently in view. If the grid contains a large
amount of data (say 50,000 rows), then not all
53
Name
Parameters
Description
extra? (number): Extra spacing, in pixels.
(default value: 4)
rows will be measured since that could
potentially take a long time.
(inherited from FlexGrid).
.
autoSizeRow(r, header?,
extra?)
r (number): Index of the row to resize.
header? (boolean): Whether the row index refers to a
regular or a header row.
(default value: false)
extra? (number): Extra spacing, in pixels.
(default value: 0)
Resizes a row to fit its content.
(inherited from FlexGrid).
autoSizeRows(firstRow?,
lastRow?, header?, extra?)
firstRow? (number): Index of the first row to resize.
lastRow? (number): Index of the last row to resize.
header? (boolean): Whether the row indices refer to
regular or header rows.
(default value: false)
extra? (number): Extra spacing, in pixels.
(default value: 0)
Resizes a range of rows to fit their content.
(inherited from FlexGrid).
beginUpdate()
Suspends notifications until the next call
to endUpdate.
(inherited from Control).
collapseGroupsToLevel
(level)
level (number): Maximum group level to show.
Collapses all the group rows to a given level.
(inherited from FlexGrid).
constructor(element,
options?)
element (any): The DOM element that will host the
control, or a selector for the host element (e.g.
'#theCtrl').
options? (): JavaScript object containing initialization
data for the control.
Initializes a new instance of
the PivotGrid class.
(inherited from PivotGrid).
containsFocus(): boolean
Checks whether this control contains the
focused element.
(inherited from FlexGrid).
49
Name
Parameters
Description
deferUpdate(fn)
fn (Function): Function to be executed.
Executes a function within
a beginUpdate/endUpdate block.
ck.
The control will not be updated until the
function has been executed. This method
ensuresendUpdate is called even if the
e
function throws.
(inherited from Control).
.
dispose()
Disposes of the control by removing its
association with the host element.
(inherited from FlexGrid).
S disposeAll(e?)
e? (HTMLElement): Container element.
Disposes of all Wijmo controls contained in
an HTML element.
(inherited from Control).
endUpdate()
Resumes notifications suspended by calls
to beginUpdate.
(inherited from Control).
finishEditing
(cancel?): boolean
cancel? (boolean): Whether pending edits should be
canceled or committed.
(default value: false)
Commits any pending edits and exits edit
mode.
Returns True if the edit operation finished
successfully.
(inherited from FlexGrid).
focus()
Overridden to set the focus to the grid without
scrolling the whole grid into view.
(inherited from FlexGrid).
getCellBoundingRect(r, c,
raw?): Rect
r (number): Index of the row that contains the cell.
c (number): Index of the column that contains the
cell.
Gets a the bounds of a cell element in
viewport coordinates.
50
Name
Parameters
Description
raw? (boolean): Whether to return the rectangle in
raw panel coordinates as opposed to viewport
coordinates.
This method returns the bounds of cells in
the cells panel (scrollable data cells). To get
et
the bounds of cells in other panels, use
the getCellBoundingRect method in the
he
appropriate GridPanel object.
t.
The returned value is a Rect object which
ich
contains the position and dimensions of the
cell in viewport coordinates. The viewport
coordinates are the same used by
the getBoundingClientRectmethod.
.
(inherited from FlexGrid).
.
getCellData(r, c,
formatted): any
r (number): Index of the row that contains the cell.
c (number): Index of the column that contains the
cell.
formatted (boolean): Whether to format the value for
display.
Gets the value stored in a cell in the scrollable
area of the grid.
(inherited from FlexGrid).
getClipString(rng?): string rng? (CellRange): CellRange to copy. If omitted, the
current selection is used.
Gets the content of a CellRange as a string
ing
suitable for copying to the clipboard.
Hidden rows and columns are not included in
the clip string.
(inherited from FlexGrid).
).
S getControl
(element): Control
element (any): The DOM element that is hosting the
control, or a selector for the host element (e.g.
'#theCtrl').
Gets the control that is hosted in a given
DOM element.
(inherited from Control).
54
Name
Parameters
Description
getDetail(row, col)
row (number): Index of the row that contains the cell.
col (number): Index of the column that contains the
cell.
Gets an array containing the records
summarized by a given grid cell.
(inherited from PivotGrid).
getMergedRange(p, r, c,
clip?):CellRange
p (GridPanel): The GridPanel that contains the
range.
r (number): Index of the row that contains the cell.
c (number): Index of the column that contains the
cell.
clip? (boolean): Whether to clip the merged range to
the grid's current view range.
(default value: true)
Gets a CellRange that specifies the merged
extent of a cell in a GridPanel.
Returns A CellRange that specifies the
merged range, or null if the cell is not merged.
(inherited from FlexGrid).
getSelectedState(r,
c): SelectedState
r (number): Row index of the cell to inspect.
c (number): Column index of the cell to inspect.
Gets a SelectedState value that indicates the
selected state of a cell.
(inherited from FlexGrid).
getTemplate(): string
Gets the HTML template used to create
instances of the control.
This method traverses up the class hierarchy
to find the nearest ancestor that specifies a
control template. For example, if you specify
a prototype for the ComboBox control, it will
ill
override the template defined by
the DropDown base class.
s.
(inherited from Control).
.
hitTest(pt, y?): HitTestInfo
pt (any): Point to investigate, in page coordinates, or
a MouseEvent object, or x coordinate of the point.
y? (number): Y coordinate of the point in page
coordinates (if the first parameter is a number).
Gets a HitTestInfo object with information
ion
about a given point.
For example:
37
Name
Parameters
Description
// hit test a point when the user clicks on the
grid
flex.hostElement.addEventListener('click',
function (e) {
var ht = flex.hitTest(e.pageX, e.pageY);
console.log('you clicked a cell of type "' +
wijmo.grid.CellType[ht.cellType] + '".');
});
Returns A HitTestInfo object with
with
information about the point.
(inherited from FlexGrid).
.
initialize(options)
options (any): Object that contains the initialization
data.
Initializes the control by copying the
properties from a given object.
This method allows you to initialize controls
using plain data objects instead of setting the
value of each property in code.
For example:
grid.initialize({
itemsSource: myList,
autoGenerateColumns: false,
columns: [
{ binding: 'id', header: 'Code', width: 130 },
{ binding: 'name', header: 'Name', width: 60 }
]
});
// is equivalent to
grid.itemsSource = myList;
grid.autoGenerateColumns = false;
// etc.
37
Name
Parameters
Description
The initialization data is type-checked as it is
applied. If the initialization object contains
unknown property names or invalid data
types, this method will throw.
(inherited from Control).
.
invalidate(fullUpdate?)
fullUpdate? (boolean): Whether to update the control
layout as well as the content.
(default value: true)
Invalidates the control causing an
asynchronous refresh.
(inherited from Control).
S invalidateAll(e?)
e? (HTMLElement): Container element. If set to null,
all Wijmo controls on the page will be invalidated.
Invalidates all Wijmo controls contained in an
HTML element.
Use this method when your application has
dynamic panels that change the control's
visibility or dimensions. For example,
splitters, accordions, and tab controls usually
change the visibility of its content elements.
In this case, failing to notify the controls
contained in the element may cause them to
stop working properly.
If this happens, you must handle the
appropriate event in the dynamic container
and call theinvalidateAll method so the
he
contained Wijmo controls will update their
layout information properly.
(inherited from Control).
.
Documents you may be interested
Documents you may be interested