I have the following code:
<script type="text/javascript">
$(function() {
var url = urltogetdata;
$("#products").kendoDropDownList({
dataTextField: "name",
dataValueField: "name",
dataSource: {
transport: {
read: {
url: url,
contentType:'application/javascript; charset=utf-8',
type:'GET',
dataType:'jsonp'
},
schema: {
data: "result"
}
}
}
});
});
</script>
<asp:HiddenField ID="webServer" runat="server" />
<asp:HiddenField ID="cred" runat="server" />
<input id="products" style="width: 250px" />
When I hit the url directly an excerpt of the response is:
{"result":[{"name":"228 - Sal ","entityIdentifier":{"id":23}},{"name":"230 - Fitters Truck","entityIdentifier":{"id":24}},{"name":"2300 - Duane Agnew","entityIdentifier":{"id":20}}, etc....
When I run this the ddl just spins and nothing happens. Why?
Also, if I want to bind the dataTextField to name and the dataValueField to the entityIdentifiers id property how would I do this?
Thanks.
<script type="text/javascript">
$(function() {
var url = urltogetdata;
$("#products").kendoDropDownList({
dataTextField: "name",
dataValueField: "name",
dataSource: {
transport: {
read: {
url: url,
contentType:'application/javascript; charset=utf-8',
type:'GET',
dataType:'jsonp'
},
schema: {
data: "result"
}
}
}
});
});
</script>
<asp:HiddenField ID="webServer" runat="server" />
<asp:HiddenField ID="cred" runat="server" />
<input id="products" style="width: 250px" />
When I hit the url directly an excerpt of the response is:
{"result":[{"name":"228 - Sal ","entityIdentifier":{"id":23}},{"name":"230 - Fitters Truck","entityIdentifier":{"id":24}},{"name":"2300 - Duane Agnew","entityIdentifier":{"id":20}}, etc....
When I run this the ddl just spins and nothing happens. Why?
Also, if I want to bind the dataTextField to name and the dataValueField to the entityIdentifiers id property how would I do this?
Thanks.