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

Enable properties by true/false

2 Answers 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mattias
Top achievements
Rank 1
Mattias asked on 30 Jan 2013, 01:28 PM
Hi,
It would be great if you could build in so some common properties are possible to enable by parameter true/false.
You have this functionality on some properties already.
It would be useful for example Create, Edit, Destroy like:
.ToolBar(commands => commands.Create(false))
It is then possible to grab this from the model like:
.ToolBar(commands => commands.Create(Model.EnableCreate))

Regards,
Mattias

2 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 30 Jan 2013, 04:15 PM
Hello Mattias,

 
I can suggest you to use the following approach:

.ToolBar(commands =>
{
     if (Model.EnableCreate)
     {
         commands.Create();
     }
})

I hope this will work in your scenario.

Greetings,
Dimiter Madjarov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Mattias
Top achievements
Rank 1
answered on 31 Jan 2013, 08:14 AM
Hi,
Not so beautiful, but yes, that should work! :)

/Mattias
Tags
Grid
Asked by
Mattias
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Mattias
Top achievements
Rank 1
Share this question
or