This is a migrated thread and some comments may be shown as answers.

Grid Inline editing - accept and start new record

1 Answer 163 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 25 Jan 2017, 05:12 PM

I am using grid with inline editing and looking for advice on how to auto-trigger 'Add new record' when a current new record update is Ctrl-Clicked or Ctrl-Entered.

If the edit row is for an existing row the Ctrl- modifier should not cause a new record.

Also, if a new row is being edited and 'Add new record' is clicked I would like to alert the user there is unsaved data.  At which point they can cancel and continue editing, accept inputs and create a new record or ignore inputs and create a new record.

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 27 Jan 2017, 01:23 PM
Hello Richard,

The desired functionality is not supported, but can be achieved via some custom implementation. A possible approach is to handle the Grid edit event, and check if the item is newly created, or an existing one is being edited via e.model.isNew().

The Update and Cancel buttons of the edited row can be retrieved via jQuery, e.g.:

var updateButton = e.container.find('.k-grid-update');
var cancelButton = e.container.find('.k-grid-cancel');

Fome boolean flag can be raised when adding the currently edited row is supposed to trigger adding a new one, for example in the dataBound event handler via the addRow() method.

I have prepared an example, illustrating the described approach to help you get started, but in general all custom implementations are in the hands of the developer:

http://dojo.telerik.com/Asepa

You can also benefit from the Progress Professional Services for any feature customization, consulting, and more:

https://www.progress.com/services/outsourcing/feature-customization

Let me know if you are interested, and I will arrange for someone from the team to contact you.

Regards,
Dimiter Topalov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or