Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145663 | Jul 2,2019 09:21 PM UTC | Jul 4,2019 05:21 AM UTC | ASP.NET MVC - EJ 2 | 3 |
![]() |
Tags: DropDownList |
@Html.EJS().DropDownListFor(model => model.Value).Placeholder("Select a game").Width("300").PopupHeight("200px").DataSource(obj =>
obj.Url("https://services.odata.org/V4/Northwind/Northwind.svc/").CrossDomain(true).Adaptor("ODataV4Adaptor")).Fields(new DropDownListFieldSettings
{
Text = "City",
Value = "City"
}).Query((string)ViewBag.query).AllowFiltering(true).Render()
<button onclick="btnClick()">Refresh data</button>
<script>
function btnClick() {
var datamanager = new ej.data.DataManager({
url: 'https://services.odata.org/V4/Northwind/Northwind.svc/',
adaptor: new ej.data.ODataV4Adaptor(),
crossDomain: true
});
var ddl = document.getElementById("Value").ej2_instances[0];
ddl.datasource = datamanager;
ddl.query = new ej.data.Query().from('Employees').select(['City']).take(10);
ddl.dataBind();
}
</script> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.