# inputEx-library

### inputEx 0.5.1

inputEx-library > inputEx > inputEx.widget.DataTable
Search:
Filters Show Private Show Protected Show Deprecated

## Class inputEx.widget.DataTable

Known Subclasses:
  inputEx.widget.dtInPlaceEdit

Create an editable datatable

### Constructor

inputEx.widget.DataTable `( options )`

Parameters:
  `options <Object>` Options:
  - parentEl: DOMelement in which we have to insert the datatable
  - datasource (or datasourceConfig)
  - datatableOpts: additionnal datatable options
  - fields: inputEx fields
  - dialogLabel: title of the dialog
  - columnDefs: YUI datatable columnDefs
  - id: (optional, default is autogenerated) sets the id of the div wrapper around the widget
  - allowInsert: adds the 'Insert' button (optional, default true)
  - allowModify: default true
  - allowDelete: default true
  - showHideColumnsDlg: add a link to a dialog to show/hide columns
  - panelConfig: (optional) YUI's dialog panelConfig object

### Properties

#### datatable - `object`

YUI's datatable instance

#### element - `object`

Main container

### Methods

#### _onCellClick

`void _onCellClick ( )`
Handling cell click events

#### fieldsToColumndefs

`void fieldsToColumndefs ( )`
Convert an inputEx fields definition to a DataTable columns definition

#### fieldToColumndef

`void fieldToColumndef ( )`
Convert a single inputEx field definition to a DataTable column definition

#### initEvents

`void initEvents ( )`
Init the events

#### onCancelForm

`void onCancelForm ( )`
Cancel row edition

#### onCellClick

`void onCellClick ( )`
Public cell click handler

#### onClickModify

`void onClickModify ( )`
Opens the Dialog to edit the row Called when the user clicked on modify button

#### onDialogCancel

`void onDialogCancel ( )`
When canceling the Dialog

#### onDialogSave

`void onDialogSave ( )`
When saving the Dialog

#### onInsertButton

`void onInsertButton ( )`
Insert button event handler

#### removeUnsavedRecord

`void removeUnsavedRecord ( )`
Remove the record that has not been saved

#### render

`void render ( )`
Render the main container only (not the datatable)

#### renderDatatable

`void renderDatatable ( )`
Render the datatable

#### renderDialog

`void renderDialog ( )`
Render the dialog for row edition

#### renderShowHideColumnsDlg

`void renderShowHideColumnsDlg ( )`
Render the dialog (+link) to show/hide columns

#### setColumnDefs

`void setColumnDefs ( )`
Set the column definitions, create them if none from the fields, adds the modify and delete buttons

#### setOptions

`void setOptions ( )`
Set the options

#### showTableOptions

`void showTableOptions ( )`
Display the dialog to show/hide fields

### Events

#### Event fired when an item is added

`Event fired when an item is added ( Added )`

Parameters:
  `Added <YAHOO.widget.Record>` record

#### Event fired when an item is modified

`Event fired when an item is modified ( Modified )`

Parameters:
  `Modified <YAHOO.widget.Record>` record

#### Event fired when an item is removed

`Event fired when an item is removed ( Removed )`

Parameters:
  `Removed <YAHOO.widget.Record>` record

Copyright © 2010 Eric Abouaf All rights reserved.