Hi there.
I have a lot of
DropDownList
s in my app like this example:
List<object>
listaHorarios = db.Horarios.OrderBy(l => l.Codigo) .Select(e => (object)new { value = e.Codigo, text = e.Descricao }).ToList();
Html.EJS().DropDownListFor(model => model.CodigoHorarioSegunda) .DataSource(listaHorarios).Fields(new DropDownListFieldSettings { Text = "text", Value = "value" }) .ShowClearButton().PopupWidth("300") .Value(Model.CodigoHorarioSegunda).Render() |
But i have to set the
DropDownListFieldSettings
in all of the DropDownList. Can't i change the default behaviour?
In one app i have, in EJ1 version, i had this code to change the default behaviour of the DropDownList:
ej.DropDownList.prototype.defaults.fields.value = "value";
ej.DropDownList.prototype.defaults.fields.text = "text";
But in the EJ2 i can't reach this properties. How can i change this?
And i would like to change the default behaviour of the PopupWidth to 'auto' too...
And i would like to avoid to put the "Created" event in all the elements too. I prefer the way i do in the EJ1 version.
Thanks