- Known Subclasses:
-
YAHOO.widget.CellEditor
YAHOO.widget.DropdownCellEditor
YAHOO.widget.TextboxCellEditor
YAHOO.widget.TextareaCellEditor
YAHOO.widget.DateCellEditor
YAHOO.widget.CheckboxCellEditor
YAHOO.widget.RadioCellEditor
The BaseCellEditor class provides base functionality common to all inline cell
editors for a DataTable widget.
Constructor
YAHOO.widget.BaseCellEditor
(
sType
,
oConfigs
)
- Parameters:
-
sType
<String>
Type indicator, to map to YAHOO.widget.DataTable.Editors.
-
oConfigs
<Object>
(Optional) Object literal of configs.
Properties
Reference to Cancel button, if available.
Default Value: null
Container for inline editor.
_elSaveBtn
- private HTMLElement
Reference to Save button, if available.
Default Value: null
_elTd
- private HTMLElement
Default Value: null
_oColumn
- private YAHOO.widget.Column
Default Value: null
_oRecord
- private YAHOO.widget.Record
Default Value: null
_sId
- private String
Unique id assigned to instance "yui-ceditorN", useful prefix for generating unique
DOM ID strings and log messages.
Implementer defined function that can submit the input value to a server. This
function must accept the arguments fnCallback and oNewValue. When the submission
is complete, the function must also call fnCallback(bSuccess, oNewValue) to
finish the save routine in the CellEditor. This function can also be used to
perform extra validation or input value manipulation.
Class applied to CellEditor container.
Default Value: "yui-ceditor"
Default value in case Record data is undefined. NB: Null values will not trigger
the default value.
Default Value: null
True if Save/Cancel buttons should not be displayed in the CellEditor.
Default Value: false
True if currently active.
Text to display on Cancel button.
Default Value: "Cancel"
Text to display on Save button.
Default Value: "Save"
If validation is enabled, resets input field of invalid data.
Default Value: true
Validator function for input data, called from the DataTable instance scope,
receives the arguments (inputValue, currentValue, editorInstance) and returns
either the validated (or type-converted) value or undefined.
Default Value: null
Methods
private
void
_initConfigs
(
)
Initialize configs.
private
void
_initEvents
(
)
Initialize Custom Events.
void
attach
(
oDataTable
,
elCell
)
Attach CellEditor for a new interaction.
- Parameters:
-
oDataTable
<YAHOO.widget.DataTable>
Associated DataTable instance.
-
elCell
<HTMLElement>
Cell to edit.
- Returns:
void
void
block
(
)
Fires blockEvent
void
cancel
(
)
Cancels CellEditor input and hides UI.
void
destroy
(
)
Nulls out the entire CellEditor instance and related objects, removes attached
event listeners, and clears out DOM elements inside the container, removes
container from the DOM.
void
doAfterRender
(
)
Access to add additional event listeners.
void
focus
(
)
Sets focus in CellEditor.
YAHOO.widget.Column
getColumn
(
)
Returns reference to associated Column instance.
- Returns:
YAHOO.widget.Column
- Column instance.
HTMLElement
getContainerEl
(
)
Returns container element.
- Returns:
HTMLElement
- Reference to container element.
YAHOO.widget.DataTable
getDataTable
(
)
Returns reference to associated DataTable instance.
- Returns:
YAHOO.widget.DataTable
- DataTable instance.
String
getId
(
)
CellEditor unique ID.
- Returns:
String
- Unique ID of the CellEditor instance.
void
getInputValue
(
)
Retrieves input value from CellEditor.
YAHOO.widget.Record
getRecord
(
)
Returns reference to associated Record instance.
- Returns:
YAHOO.widget.Record
- Record instance.
HTMLElement
getTdEl
(
)
Returns reference to associated TD element.
- Returns:
HTMLElement
- TD element.
void
handleDisabledBtns
(
)
After rendering form, if disabledBtns is set to true, then sets up a mechanism
to save input without them.
void
move
(
)
Moves container into position for display.
void
render
(
)
Renders DOM elements and attaches event listeners.
void
renderBtns
(
)
Renders Save/Cancel buttons.
void
renderForm
(
)
Renders form elements.
void
resetForm
(
)
Resets CellEditor UI to initial state.
void
save
(
)
Saves value of CellEditor and hides UI.
void
show
(
)
Displays CellEditor UI in the correct position.
String
toString
(
)
CellEditor instance name, for logging.
- Returns:
String
- Unique name of the CellEditor instance.
void
unblock
(
)
Fires unblockEvent
Events
blurEvent
(
oArgs.editor
)
Fired when a CellEditor has a blur event.
- Parameters:
-
oArgs.editor
<YAHOO.widget.CellEditor>
The CellEditor instance.
cancelEvent
(
oArgs.editor
)
Fired when a CellEditor input is canceled.
- Parameters:
-
oArgs.editor
<YAHOO.widget.CellEditor>
The CellEditor instance.
invalidDataEvent
(
oArgs.editor
,
oArgs.newData
,
oArgs.oldData
)
Fired when a CellEditor input is reverted due to invalid data.
- Parameters:
-
oArgs.editor
<YAHOO.widget.CellEditor>
The CellEditor instance.
-
oArgs.newData
<Object>
New data value from form input field.
-
oArgs.oldData
<Object>
Old data value.
keydownEvent
(
oArgs.editor
,
oArgs.event
)
Fired when a CellEditor has a keydown.
- Parameters:
-
oArgs.editor
<YAHOO.widget.CellEditor>
The CellEditor instance.
-
oArgs.event
<HTMLEvent>
The event object.
revertEvent
(
oArgs.editor
,
oArgs.newData
,
oArgs.oldData
)
Fired when a CellEditor input is reverted due to asyncSubmitter failure.
- Parameters:
-
oArgs.editor
<YAHOO.widget.CellEditor>
The CellEditor instance.
-
oArgs.newData
<Object>
New data value from form input field.
-
oArgs.oldData
<Object>
Old data value.
saveEvent
(
oArgs.editor
,
oArgs.newData
,
oArgs.oldData
)
Fired when a CellEditor input is saved.
- Parameters:
-
oArgs.editor
<YAHOO.widget.CellEditor>
The CellEditor instance.
-
oArgs.newData
<Object>
New data value from form input field.
-
oArgs.oldData
<Object>
Old data value.
showEvent
(
oArgs.editor
)
Fired when a CellEditor is shown.
- Parameters:
-
oArgs.editor
<YAHOO.widget.CellEditor>
The CellEditor instance.