DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
221 stars 78 forks source link

Add Disabled() for CheckBoxListFor #379

Closed akamud closed 9 years ago

akamud commented 9 years ago

There is no CheckBoxListFor.Disabled(true), to me it looks very similar to RadioButtonsFromEnumFor, which has Disabled method.
Is this doable?

DmitryEfimenko commented 9 years ago

There is a more flexible method available for CheckBoxListFor - .DisableValues(expression). It allows you to disable values conditionally based on the item in the data source. If all you want is to disable all checkboxes, simply write:

.DisabledValues(x => true)
akamud commented 9 years ago

Awesome, haven't noticed this one.
Thank you, you can close this.