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

New Insert after Insert or Update

5 Answers 204 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alessandro
Top achievements
Rank 1
Alessandro asked on 28 Oct 2016, 12:55 PM

Hi, 

I've a grid with a custom editor template.

I need to open a new popup for a new record insert after the user updated o inserted the record before by clicking on a dedicated button

How can I do that?

5 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 01 Nov 2016, 11:32 AM
Hi Alessandro,

You can use the requestEnd event handler of the grid DataSource instance to achieve this requirement:
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-requestEnd

You can check its type argument and if it equals "update", you can use the client-side API of the grid widget to open a new insert form or edit a given record:
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-addRow

I hope this will prove helpful.

Regards,
Eyup
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Alessandro
Top achievements
Rank 1
answered on 02 Nov 2016, 09:29 AM

Hi,

thank you for your answer, but the DataSource's event requestEnd is fired only ones at grid loaded.

0
Eyup
Telerik team
answered on 04 Nov 2016, 08:21 AM
Hi Alessandro,

It should be raised on other actions as well. Alternatively, you can also experiment with the change event handler:
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-change

Regards,
Eyup
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Alessandro
Top achievements
Rank 1
answered on 04 Nov 2016, 02:01 PM

Hi,
thank you, now it works.
But when i do this:
var grid = $("#grid").data("kendoGrid");
grid.addRow();

I find a new empty line on the grid and the pop-up doesn't appear
I've already configured the grid for editing in popup mode
Thank you

0
Eyup
Telerik team
answered on 08 Nov 2016, 10:58 AM
Hi Alessandro,

Generally, the method should work as expected:
http://dojo.telerik.com/eteWA/2

You can enable your script debugger (FireBug or F12) and see whether there are any script errors interfering.

Regards,
Eyup
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
Grid
Asked by
Alessandro
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Alessandro
Top achievements
Rank 1
Share this question
or