or
function
BuildTree() {
$(xmlDoc.getElementsByTagName(
"Item"
)).each(
function
() {
var
thisItem = $(
this
);
var
list =
" "
;
var
list1 =
" "
;
$(parentIDFields).each(
function
(index, item) {
if
(thisItem.attr(item) !=
null
&& thisItem.attr(descriptionCol) !=
null
) {
if
(index == 0) {
list +=
"<li id="
+ thisItem.attr(
"ID"
) +
" onclick=sendHTML("
+ thisItem.attr(
"ID"
) +
");>"
+ thisItem.attr(item);
list1 +=
"</li>"
;
}
else
{
list +=
"<ul><li id="
+ thisItem.attr(
"ID"
) +
" onclick=sendHTML("
+ thisItem.attr(
"ID"
) +
");>"
+ thisItem.attr(item);
list1 +=
"</li></ul>"
;
}
}
});
$(
"#treeView"
).append(list +
"<ul><li id="
+ thisItem.attr(
"ID"
) +
">"
+ thisItem.attr(descriptionCol) +
" </li></ul>"
+ list1);
});
$(document).ready(
function
() {
$(
"#treeView"
).kendoTreeView();
});
}
$(
"#combobox"
).kendoComboBox({
dataTextField:
"Description"
,
dataValueField:
"Code"
,
filter:
"contains"
,
minLength: 3,
autoBind:
false
,
dataSource: {
type:
"json"
,
serverFiltering:
true
,
transport: {
read: {
url: serviceUrl +
"HpCodes"
,
contentType:
"application/json; charset=utf-8"
,
dataType:
"json"
,
data: {
partialName:
function
() {
return
$(
"#combobox"
).val();
}
}
}
}
}
});
var
ds =
new
kendo.data.DataSource({
transport: {
read: {
url:
"http://localhost:3000/api/anagram"
,
dataType:
"jsonp"
,
data: {
format:
'html'
}
},
parameterMap:
function
(options) {
if
(options.filter && options.filter.filters.length > 0)
return
{
rack: options.filter.filters[0].value.replace(/\?/g,
'-'
),
format:
'html'
,
limit: options.pageSize,
page: options.page
};
return
options;
}
},
group:
'length'
,
pageSize: 10,
page: 1,
sort: {field:
'w'
, dir:
'asc'
},
filter: { field:
'rack'
, operator:
'eq'
, value:
'z'
},
serverFiltering:
true
,
serverPaging:
true
,
serverGrouping:
true
,
serverSorting:
true
,
error:
function
(e){
alert(e);
console.log(e);
},
change:
function
(e) {
console.log(
'Data changed: '
+
this
.total());
},
schema: {
groups:
'groups'
,
total:
'count'
,
model: {
fields: {
length: {
type:
'number'
},
w: {
type:
'string'
},
f: {
type:
'string'
}
}
}
}
});
Number is not null{
Number is null{
"id"
:
"0422842A222780"
,
"number"
:
"0422842A222780"
}
{
"id"
:
"0422842A222780"
}
As a result I see empty grid. When I remove this field from displaying all works fine Is there any solution?model:{
id:
"id"
,
fields:{
id:{type:
"string"
, editable:
false
},
number:{type:
"string"
, editable:
false
, nullable:
true
},
}
}
SCRIPT5007: Unable to get value of the property 'length': object is null or undefined
kendo.custom.min.js, line 12 character 1304
kendo.bind($(
"#content"
), viewModel);