Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141933 | Jan 10,2019 10:47 PM UTC | Jan 29,2019 01:02 PM UTC | ASP.NET Web Forms | 5 |
![]() |
Tags: ComboBox |
<ej:ComboBox ID="cmbEmployerLocation" runat="server" Width="300px" DataTextField="ContactName" DataValueField="SupplierID" Placeholder="Select a state">
<DataManager URL="https://js.syncfusion.com/ejServices/wcf/NorthWind.svc/" CrossDomain="true"></DataManager>
</ej:ComboBox>
<br />
<ej:Button runat="server" Type="Button" Text="Change Query" ClientSideOnClick="QueryChange"></ej:Button>
<script>
function QueryChange(args)
{
var employerLocationObj = $('#<%= cmbEmployerLocation.ClientID %>').data("ejComboBox");
employerLocationObj.setModel({
query: ej.Query().from('Suppliers').select('SupplierID', 'ContactName').take(10),
actionComplete: function (arg) {
if (arg.result.length > 0) {
preValue = arg.result[0].SupplierID;
listObj1 = $('#<%=cmbEmployerLocation.ClientID%>').ejComboBox("instance");
this.setModel({ value: preValue });
}
}
});
}
</script> |
<script>
function QueryChange(args) {
var employerLocationObj = $('#<%= cmbEmployerLocation.ClientID %>').data("ejComboBox");
employerLocationObj.setModel({
query: ej.Query().from('Suppliers').select('SupplierID', 'ContactName').take(10),
actionComplete: function (arg) {
if (arg.result.length > 0) {
this.setModel({ index: 0 });
}
}
});
}
</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.