BiInlineEditModel
This class is used to handle inline editing in a BiTreeView and a BiOlapGrid. This class provides editing by using one attached component at a time.
This class extends BiAttachedComponentModel and therefore all methods and fields available for BiAttachedComponentModel are also available for BiInlineEditModel .
Constructor
new BiInlineEditModel ( )
Parameters
No parameters.
Properties
| Name | Type | get | set | Descripton |
column | Number | ![]() | The column that is edited | |
currentEditComponent | | ![]() | The attached component that is used to edit the value of the cell | |
isEditing | Boolean | ![]() | Whether we are currently editing a cell | |
row | Number | ![]() | The row that is edited | |
value | Object | ![]() | ![]() | The value of the currently editing cell |
Methods
| Name | Description |
cancelEdit | Ends the current editing of the cell without raising a change event |
commitEdit | Ends the current editing of the cell but fires of a change event |
createAttachedComponent | Creates an attached component for a certain type. This implementation supports BiInlineEditModel.EDIT_TYPE_STRING (BiTextBox), BiInlineEditModel.EDIT_TYPE_ENUM (BiComboBox), BiInlineEditModel.EDIT_TYPE_NUMBER (BiSpinner) and BiInlineEditModel.EDIT_TYPE_BOOLEAN (BiCheckBox). You may override this to add your own components. If you do, you will have to add an event-listener that sets the text on this model to the component's value when it changes. |
getCanEdit | Whether we can edit the cell at the given position |
getEditOptions | This provides some options for the current edit component. The type of Object returned is not well defined and different edit types uses different options. For EDIT_TYPE_NUMBER the object can contain a field called maximum and a field called minimum and these will be used as properties on the BiSpinner.For EDIT_TYPE_ENUM, which is displayed as a combo box, the options describe the items in the combo box and the options object can be an array of objects with text and userValue fields. If userValue has been set for the object (option), then that is the value that will be returned when getValue() is called. |
getEditType | Returns the type of editing we want to use for the cell at the given position |
setEditCell | Sets the cell to edit. In order to start editing the cell is necessary to call the startEditing method of the owner. |
Events
| Name | Type | Bubbles | Descripton |
beforehide | | This happens before the editing component is hidden. If the default action is prevented here the component is not removed from the tree view | |
beforeshow | | This event is dispatched before the editing component is added to the BiTreeView component | |
change | | This event is fired when the value of the currently editing cell has changed. | |
hide | | When the editing component has been removed/hidden. |
Static Methods
None.
Static Fields
| Name | Type | Descripton |
EDIT_TYPE_BOOLEAN | Number | Constant for editing a Boolean value. This shows a check-box for editing the value as the attached component |
EDIT_TYPE_ENUM | Number | Constant for selection one value out of a few options. This type shows a BiComboBox as the attached component |
EDIT_TYPE_NUMBER | Number | Constant for editing a number value. This shows a spinner for editing the value as the attached component |
EDIT_TYPE_STRING | Number | Constant for editing a string value. This type shows a simple BiTextField as the attached component |
Remarks
None.
Method Details
cancelEdit
Ends the current editing of the cell without raising a change event
Syntax
object.cancelEdit ( ) Parameters
No arguments.
Return Type
void
commitEdit
Ends the current editing of the cell but fires of a change event
Syntax
object.commitEdit ( ) Parameters
No arguments.
Return Type
void
createAttachedComponent
Creates an attached component for a certain type. This implementation supports BiInlineEditModel.EDIT_TYPE_STRING (BiTextBox), BiInlineEditModel.EDIT_TYPE_ENUM (BiComboBox), BiInlineEditModel.EDIT_TYPE_NUMBER (BiSpinner) and BiInlineEditModel.EDIT_TYPE_BOOLEAN (BiCheckBox). You may override this to add your own components. If you do, you will have to add an event-listener that sets the text on this model to the component's value when it changes.
Syntax
object.createAttachedComponent ( nEditType ) Parameters
| Name | Type | Optional | Default | Descripton |
nEditType | Number | The number returned by getEditType(x, y). |
Return Type
getCanEdit
Whether we can edit the cell at the given position
Syntax
object.getCanEdit ( x,y ) Parameters
| Name | Type | Optional | Default | Descripton |
x | Number | The column of the cell we want to edit | ||
y | Number | The row of the cell we want to edit |
Return Type
Boolean
getEditOptions
This provides some options for the current edit component. The type of Object returned is not well defined and different edit types uses different options.
For EDIT_TYPE_NUMBER the object can contain a field called maximum and a field called minimum and these will be used as properties on the BiSpinner.
For EDIT_TYPE_ENUM, which is displayed as a combo box, the options describe the items in the combo box and the options object can be an array of objects with text and userValue fields. If userValue has been set for the object (option), then that is the value that will be returned when getValue() is called.
Syntax
object.getEditOptions ( x,y ) Parameters
| Name | Type | Optional | Default | Descripton |
x | Number | The column of the editing cell | ||
y | Number | The row of the editing cell |
Return Type
Object
getEditType
Returns the type of editing we want to use for the cell at the given position
Syntax
object.getEditType ( x,y ) Parameters
| Name | Type | Optional | Default | Descripton |
x | Number | The column of the cell we want to edit | ||
y | Number | The row of the cell we want to edit |
Return Type
Number
setEditCell
Sets the cell to edit. In order to start editing the cell is necessary to call the startEditing method of the owner.
Syntax
object.setEditCell ( x,y ) Parameters
| Name | Type | Optional | Default | Descripton |
x | Number | The column that the cell is at | ||
y | Number | The row that the cell is at |
Return Type
void
