I am new to kendo UI HTML v2013.1.226 .I am trying cascading combo box within the kendo grid.In this fiddle http://jsfiddle.net/moonolite3/abgy56ak/6/
Html:
Script:
When I select the 'ship's Country' the 'ship's City' Column need to get invoked and list out the city name but its not doing that.Ship's city in turn need to invoke ship's Name .In kendo site the demo cascading is on outside the grid and I didn't get how to do the same inside the grid.Can any one help me out or with any other sample fiddle..Thanks in Advance.Note: I need to stick with this kendo version..cant change to updated one :(
Html:
<
div
id
=
"myLayout"
class
=
"k-content"
style
=
"background-color:Gray; height:100%;"
>
<
div
id
=
"contentArea"
style
=
"background-color:Silver;"
>
<
div
id
=
"myList"
></
div
>
</
div
>
<
div
id
=
"footer"
style
=
"background-color:Silver;"
>
Click on ShipCity to trigger custom editor
</
div
>
Script:
var myDataSource = new kendo.data.DataSource({
type: "odata",
transport: {
},
schema: {
model: {
id: "OrderID",
fields: {
OrderID: { type: "number" },
ShipName: { type: "string" },
ShipCountry: { type: "string" },
ShipCity: { type: "string" },
ShipName: { type: "string" }
}
}
},
pageSize: 50,
serverPaging: true,
serverFiltering: true,
});
var $footer = $("#footer");
var gridHeight = function () {
return $(window).height() - $footer.height() - 2;
}
var $grid = $("#myList").kendoGrid({
scrollable: { virtual: true },
editable: true,
dataSource: myDataSource,
sortable: true,
height: gridHeight(),
columns: [
{ field: "OrderID" },
{ field: "ShipName"},
{ field: "ShipCountry",
title : "Ship's Country",
editor: function(container, options) {
$('<
input
id
=
"ShipCountry1"
required
data-text-field
=
"ShipCountry"
data-value-field
=
"ShipCountry"
data-bind
=
"value:' + options.field + '"
/>').appendTo(container).kendoComboBox({
filter: "contains",
placeholder: "Select category...",
dataTextField: "ShipCountry",
dataValueField: "ShipCountry",
dataSource: {
type: "odata",
serverFiltering: true,
transport: {
read: 'http://demos.kendoui.com/service/Northwind.svc/Orders?$select=ShipCountry'
}
},
});
}
},
{ field: "ShipCity",
title : "Ship's City",
editor: function(container, options) {
$('<
input
id
=
"ShipCity1"
required
data-text-field
=
"ShipCity"
data-value-field
=
"ShipCity"
data-bind
=
"value:' + options.field + '"
/>').appendTo(container).kendoComboBox({
autoBind: false,
cascadeFrom: "ShipCountry1",
filter: "contains",
placeholder: "Select product...",
dataTextField: "ShipCity",
dataValueField: "ShipCity",
dataSource: {
type: "odata",
transport: {
read:'http://demos.kendoui.com/service/Northwind.svc/Orders?$select=ShipCity'
}
}
});
}
},
{ field: "ShipName",
title : "Ship's Name",
editor: function(container, options) {
$('<
input
id
=
"ShipName1"
required
data-text-field
=
"ShipName"
data-value-field
=
"ShipName"
data-bind
=
"value:' + options.field + '"
/>').appendTo(container).kendoComboBox({
autoBind: false,
cascadeFrom: "ShipCity1",
filter: "contains",
placeholder: "Select product...",
dataTextField: "ShipName",
dataValueField: "ShipName",
dataSource: {
type: "odata",
transport: {
read:'http://demos.kendoui.com/service/Northwind.svc/Orders?$select=ShipName'
}
}
});
}
}
]
});
$("#rootLayout").kendoSplitter({
orientation: "vertical",
panes: [
{ scrollable: false, collapsible: false, size: "90%" },
{ collapsible: true, size: "10%" }
]
});
var resizeGrid = function () {
var dataArea = $grid.find(".k-grid-content");
var newHeight = gridHeight();
var diff = $grid.innerHeight() - dataArea.innerHeight();
$grid.height(newHeight);
dataArea.height(newHeight - diff);
}
$(window).resize(function () {
resizeGrid();
});
When I select the 'ship's Country' the 'ship's City' Column need to get invoked and list out the city name but its not doing that.Ship's city in turn need to invoke ship's Name .In kendo site the demo cascading is on outside the grid and I didn't get how to do the same inside the grid.Can any one help me out or with any other sample fiddle..Thanks in Advance.Note: I need to stick with this kendo version..cant change to updated one :(