Maybe i am just old.. but i have worked on this thing all day with no love.
This is my latest:
$(document).ready(function () {
var selectedRegionId;
var dsCategories;
$("#selectCategory").width(180).kendoComboBox({
dataTextField: "CostDriverCategoryName",
dataValueField: "CostDriverCategoryId",
dataSource: dsCategories
});
dsCategories = new kendo.data.DataSource({
transport: {
read: "/CostDriver/GetCostDriverCategoriesByRegion/" + $("input[name='region']").val(),
data: $("input[name='region']").val()
}
});
$("#selectCommodity").width(180).kendoComboBox({ enabled: false });
$("input[name='region']").click(function () {
// alert(selectedRegionId);
dsCategories.read();
});
});
I have a few issues:
1. HOW do you make the "data" parameter in the transport read work for a GET call to an ASP.Net MVC JsonResult controller method? I have searched the docs and these forums. I see people avoiding the wrapper and calling using jquery Ajax directly.. but seriously,, this datasource is a wrapper for Jquery ajax calls.. does it not work????
2. My result is a JSON object that looks like:
What do i need to do to have this result actually bind to the combobox as i defined in the combobox itself? I can get the result from the read by passing the data value right in the URL itself. Fine.. But it does not bind to the combobox.
Thanks.
This is my latest:
$(document).ready(function () {
var selectedRegionId;
var dsCategories;
$("#selectCategory").width(180).kendoComboBox({
dataTextField: "CostDriverCategoryName",
dataValueField: "CostDriverCategoryId",
dataSource: dsCategories
});
dsCategories = new kendo.data.DataSource({
transport: {
read: "/CostDriver/GetCostDriverCategoriesByRegion/" + $("input[name='region']").val(),
data: $("input[name='region']").val()
}
});
$("#selectCommodity").width(180).kendoComboBox({ enabled: false });
$("input[name='region']").click(function () {
// alert(selectedRegionId);
dsCategories.read();
});
});
I have a few issues:
1. HOW do you make the "data" parameter in the transport read work for a GET call to an ASP.Net MVC JsonResult controller method? I have searched the docs and these forums. I see people avoiding the wrapper and calling using jquery Ajax directly.. but seriously,, this datasource is a wrapper for Jquery ajax calls.. does it not work????
2. My result is a JSON object that looks like:
][{"CostDriverCategoryId":2,"CostDriverCategoryName":"Chemicals","ShortName":null},{"CostDriverCategoryId"
:3,"CostDriverCategoryName":"Currency","ShortName":null}
What do i need to do to have this result actually bind to the combobox as i defined in the combobox itself? I can get the result from the read by passing the data value right in the URL itself. Fine.. But it does not bind to the combobox.
Thanks.