here’s my kendoUI combobox using mvc3 wrapper.
@(Html.Kendo().ComboBoxFor(x => x.K1State)
.Name("ddK1State")
.DataTextField("Name")
.DataValueField("Id")
.BindTo((List<StateVM>)ViewData["State"])
.HtmlAttributes(new { @class = "input-small", @Id = "ddK1State", @style = "width:88px;" })
.Events(events => events.Change("onK1StateChange")))
I can use class and style.
.HtmlAttributes(new { @class = "input-small", @Id = "ddK1State", @style = "width:88px;" })
I change it using kendo-knockout.js file.
<input data-bind=" kendoComboBox: { enabled: k1Address.isStateMutable, dataTextField: 'Name', dataValueField: 'Id', data: states, value: k1Address.stateId, htmlAttributes: 'new {style=\'width: 88px;\'}'}" />
the style is not working. I couldn’t find “htmlAttributes” in combobox docs, probably thats why its not working.
Why don’t you set the style directly to the input element?
There is no such conception as HtmlAttributes with the JavaScript widget – it’s just used in the MVC world.