Hi,
I'm a newbie and trying to get a pair of cascading comboboxes to work from a grid custom editor popup.
The first combobox appears to work fine, but the second one does not appear to be getting the value of the selected item from the first combobox. Accordingly, the 2nd datasource is being called without a paramater
Here is my code. Thanks for assistance.
I'm a newbie and trying to get a pair of cascading comboboxes to work from a grid custom editor popup.
The first combobox appears to work fine, but the second one does not appear to be getting the value of the selected item from the first combobox. Accordingly, the 2nd datasource is being called without a paramater
Here is my code. Thanks for assistance.
$(document).ready(function() {
var element = $("#qcgrid").kendoGrid({
dataSource: {
type: "json",transport: {
read: {url: "/backoffice/archiveitemlist"},
update: {url: "/backoffice/qcupdate"},
destroy: {url: "/backoffice/qcdestroy"},
parameterMap: function(options, operation) {
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
}
},
pageSize: 6,
batch: true,
schema: {
model: {
id: "FileName",
fields: {
Description: {},
catdescription: {},
catsubdescription: {},
StartDate: {},
EndDate: {},
StartYear:{},
EndYear:{},
}
}
}
},
height: 450,
//sortable: true,
//pageable: true,
detailTemplate: kendo.template($("#mytemplate").html()),
detailInit: detailInit,
dataBound: function() {
this.expandRow(this.tbody.find("tr.k-master-row").first());
},
columns: [
// {
// field: "ArchiveItemId",
// title: "ArchiveItemId"
// },
{
field: "FileName",
},
{
field: "Description",
},
{
field: 'catdescription',
title: "Category",
editor: function(container, options) {
// create first box of a KendoUI cascading combobox widget as column editor
$('<input name="' + options.field + '"/>').appendTo(container).kendoComboBox({
placeholder: "Select category...",
dataTextField: "Category",
dataValueField: "CategoryId",
dataSource: {
type: "JSON",
serverFiltering: true,
transport: {
read: "/backoffice/categories.json"
}
}
});
}
},
{
field: 'catsubdescription',
title: "SubCategory",
editor: function(container, options) {
// create second cascading combobox widget
$('<input name="' + options.field + '"/>').appendTo(container).kendoComboBox({
autoBind: false,
cascadeFrom: "catdescription",
placeholder: "Select subcategory...",
dataTextField: "SubCategory",
dataValueField: "SubCategoryId",
dataSource: {
type: "JSON",
serverFiltering: true,
transport: {
read: "/backoffice/subcategories.json?filter[filters][0][value]=" //No value is being appended here
}
}
}).data("kendoComboBox");
}
},