or
EntityResource.query(
function
(entities)
{
//Entities are loaded dynamically when project selected.
//form data and append to tree
treeview.append(..., projectNode);
}
EntityResource.query(
function
(entities)
{
var
localDataSource =
new
kendo.data.HierarchicalDataSource({ data: entities});
localDataSource .fetch();
treeview.append(localDataSource ,projectNode);
}
var
hierarchialEntities = [ {
EntityName:
"Parent1"
,
items: [
{ EntityName:
"Entity1"
, class:
'.entity-node'
, isEntity:
true
},
{ EntityName:
"Entity2"
, class:
'.entity-node'
, isEntity:
true
},
{ EntityName:
"Entity3"
, class:
'.entity-node'
, isEntity:
true
,
items: [{ EntityName:
"Entity7"
, class:
'.entity-node'
, isEntity:
true
}]
}
]
}, {
EntityName:
"Parent2"
,
items: [
{ EntityName:
"Entity4"
, class:
'.entity-node'
, isEntity:
true
},
{ EntityName:
"Entity5"
, class:
'.entity-node'
, isEntity:
true
},
{ EntityName:
"Entity6"
, class:
'.entity-node'
, isEntity:
true
}
]
}
];
treeview.append(hierarchialEntities,projectNode); //works as expected!!!
$(
"#gridCityCodes"
).css(
"top"
,
"46px"
).kendoGrid({
dataSource:
this
.gridDataSource,
sortable:
true
,
editable:
true
,
selectable:
"multiple"
,
navigatable:
true
,
filterable:
true
,
resizable:
true
,
columnMenu:
true
,
change:
this
.gridChanged,
toolbar: [{ name:
"save"
, text: userMsgs.Save }, { name:
"cancel"
, text: userMsgs.Cancel}],
columns: [{ field:
"CityAlpha"
, width:
"100px"
, title: userMsgs.CityCode, filterable:
this
.fixGridFilterPopups },
{ field:
"CityNumeric"
, width:
"150px"
, title: userMsgs.IataCityCode, filterable:
this
.fixGridFilterPopups },
{ field:
"Description"
, width:
"300px"
, title: userMsgs.Description, filterable:
this
.fixGridFilterPopups },
{ field:
"NextFlightEnabled"
, width:
"200px"
, title: userMsgs.NextFlightEnabled, filterable:
this
.fixGridFilterPopups}],
dataBound:
function
() {
window.selectedModuleViewModel.reHighlightSelectedRows();
window.selectedModuleViewModel.pullColumnsForFiltering();
}
});
fixGridFilterPopups: {
ui:
function
(element) {
/* logic commented out to do nothing right now. */
}
}
var
ObservableObject = Observable.extend({
init:
function
(value) {
var
that =
this
,
member,
field,
parent =
function
() {
return
that;
};
Observable.fn.init.call(
this
);
for
(field
in
value) {
member = value[field];
if
(field.charAt(0) !=
"_"
) {
member = that.wrap(member, field, parent);
// <-------- error occurs here
}
that[field] = member;
}
that.uid = kendo.guid();
},
@using Kendo.Mvc.UI;
@model DataModels.Picking.PickingAssignmentItemType
@(Html.Kendo().DropDownList()
.Name("Type")
.DataTextField("Description")
.DataValueField("TypeCode")
.DataSource(source => source
.Read("GetAssignmentTypes", "Picking")
.ServerFiltering(true)
)
)
@using Kendo.Mvc.UI;
@model DataModels.Picking.PickingAssignmentItemViewModel
@(Html.Kendo().DropDownList()
.Name("ParentItem")
.DataTextField("ItemId")
.DataValueField("ItemId")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetAssignmentKits", "Picking")
.Data("filterTypes");
})
.ServerFiltering(true);
})
.CascadeFrom("Type")
)
<
script
>
function filterTypes() {
return {
Type: $("#Type").val()
};
}
</
script
>