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

Save And new Popup

2 Answers 221 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ramy
Top achievements
Rank 1
Ramy asked on 02 Oct 2015, 09:04 AM

Hi,

I'm trying to make the following scenario, i searched for it, tried to extend the Grid but sadly i cant figure it out.

I'm adding a new row to the Grid, mode is popup. its just a simple html template , and of course the Update/Cancel button are appended by the Grid. ( for now its working perfectly)
I Added a third button which is "Save & New"  and renamed the Update to "Save & Close".
The "Save & Close" Button is working as expected, the row is inserted and the popup is closed, (the default behaviour)
What I'm trying to achieve with the "Save & New", is simply, not to let the popup close after the insertion of the row, and of course clear the fields, so the user can re-fill them. ( straight forward business logic ).

is there ​a way that i can achieve this logic? I guess we can because when i press the Add button in the toolbar, the fields are emptied ( the model is emptied )

what are the events that I need to look at? is there a special one that I should extend?

Thanks

2 Answers, 1 is accepted

Sort by
0
Ramy
Top achievements
Rank 1
answered on 02 Oct 2015, 11:29 AM

ok so I'm answering myself :P

you can get the model that you are creating/editing anytime by calling:
$('#grid-employees').data('kendoGrid').editable.options.model;

 you can simply clone it once the "Edit' event is triggered and the re-assign it on the "Requestend" event.

but the problem is how to add a new type in e.type in the "requestend" event ? or how to trigger the open popu once the save and new button is clicked ?

0
Boyan Dimitrov
Telerik team
answered on 06 Oct 2015, 09:14 AM

Hello Ramy,

 

I am afraid that such scenario (editing a new model without closing the popup editor) is not supported of the box. Internally the Kendo UI Grid should instantiate a new editable instance and open the popup editor for the new item. 

 

So basically in order to achieve the desired functionality the popup editor should be closed and open a new popup editor. 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Ramy
Top achievements
Rank 1
Answers by
Ramy
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or