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

Conditionally add new record on Grid

3 Answers 209 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Man
Top achievements
Rank 1
Man asked on 02 Dec 2015, 03:23 PM

Is there a way to conditionally enable/disable the Add new Record command?

 

We have a scenario where users are allowed to add a record only if a specific pre-requisite criteria is met which can be checked from the back end 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 02 Dec 2015, 04:05 PM
Hi Man,

The first option would be to hide/remove/disable the button using javascript / jQuery.

Alternatively, you can remove the built-in toolbar altogether and create your own depending on your preferences:
http://demos.telerik.com/kendo-ui/toolbar/index

Regards,
Eyup
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Man
Top achievements
Rank 1
answered on 02 Dec 2015, 04:45 PM

Many thanks for the response Eyup. However,creating a toolbar causes me the pain of creating the controls again and then triggering the grid's data read manually. 

As an example 

Essentially, we need to allow users to place an order only if there is stock 

Finally, we also want to be able to have buttons on the add form to be called "Order now", "Order Later", "Cancel" instead of the "Update", "Cancel"

 

 

0
Boyan Dimitrov
Telerik team
answered on 04 Dec 2015, 01:16 PM

Hello Man,

 

I am not complete sure that I understand the scenario. By default in order to be able to add new record the toolbar "create" is used. Of course there is way to use the Kendo UI DataSource API and specifically the add/insert method in order to add a new record. 

 

Could you please elaborate a bit more? 

 

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
Man
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Man
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or