Search results

Edit API in Vue Grid API component

The Edit module is used to handle editing actions.

Methods

addRecord

To adds a new row at the top with the given data. When data is not passed, it will add empty rows.

editSettings.allowEditing should be true.

Parameter Type Description
data (optional) Object Defines the new add record data.
index (optional) number Defines the row index to be added

Returns void

batchCancel

Resets added, edited, and deleted records in the batch mode.

Returns void

batchSave

Bulk saves added, edited, and deleted records in the batch mode.

Returns void

closeEdit

Cancels edited state.

Returns void

deleteRecord

Deletes a record with the given options. If fieldname and data are not given, the Grid will delete the selected record.

editSettings.allowDeleting should be true.

Parameter Type Description
fieldname (optional) string Defines the primary key field name of the column.
data (optional) Object Defines the JSON data record to be deleted.

Returns void

deleteRow

Deletes a visible row by TR element.

Parameter Type Description
tr HTMLTableRowElement Defines the table row element.

Returns void

editCell

Changes a particular cell into edited state based on the row index and field name provided in the batch mode.

Parameter Type Description
index number Defines row index to edit a particular cell.
field string Defines the field name of the column to perform batch edit.

Returns void

editFormValidate

Checks the status of validation at the time of editing. If validation is passed, it returns true.

Returns boolean

endEdit

If Grid is in editable state, you can save a record by invoking endEdit.

Returns void

getBatchChanges

Gets the added, edited,and deleted data before bulk save to the DataSource in batch mode.

Returns Object

getCurrentEditCellData

Gets the current value of the edited component.

Returns Object

saveCell

Saves the cell that is currently edited. It does not save the value to the DataSource.

Returns void

startEdit

Edits any bound record in the Grid by TR element.

Parameter Type Description
tr (optional) HTMLTableRowElement Defines the table row to be edited.

Returns void

updateCell

To update the specified cell by given value without changing into edited state.

Parameter Type Description
rowIndex number Defines the row index.
field string Defines the column field.
value string | number | boolean | Date Defines the value to be changed.

Returns void

updateRow

To update the specified row by given values without changing into edited state.

Parameter Type Description
index number Defines the row index.
data Object Defines the data object to be updated.

Returns void