|
@Html.EJ().DropDownList("ddlBU1").Datasource((IEnumerable<Languages>)ViewBag.datasource).DropDownListFields(f => f.Text("text").Value("value")).Text("JavaScript") |
|
@Html.EJ().DropDownList("ddlBU2").Datasource((IEnumerable<Languages>)ViewBag.datasource).DropDownListFields(f => f.Text("text").Value("value")).Value("3") |
|
<ej-drop-down-list id="ddlBU" datasource="ViewBag.datasource" watermark-text="Select BU" >
<e-drop-down-list-fields text="text" value="id" />
</ej-drop-down-list>
<br />
<button id="text" onclick="textChange()" > Change text </button>
<br />
<button id="text" onclick="valueChange()"> Change value </button>
<script>
function textChange() {
var ddlObj = $("#ddlBU").data("ejDropDownList");
ddlObj.setModel({ text: "CBR 150-R" });
}
function valueChange() {
var ddlObj = $("#ddlBU").data("ejDropDownList");
ddlObj.setModel({ value: "bk10" });
}
</script> |