EasyUI Forum

General Category => Bug Report => Topic started by: kingor2001 on June 24, 2014, 12:25:51 AM



Title: a bug about treegrid's node id set to number 0
Post by: kingor2001 on June 24, 2014, 12:25:51 AM
Treegrid's node id can't be number 0. If id is number 0, and its children nodes cannot access the node by method "getParent". The "getParent" always return null. If id is string "0", it's all ok.
such as:
A:
Code:
[{
"id":1,
"name":"C",
"children":[{
"id":2,
"name":"Program Files"
}]
}]
B:
Code:
[{
"id":0,
"name":"C",
"children":[{
"id":2,
"name":"Program Files"
}]
}]
C:
Code:
:
var parent = $('#tg').treegrid('getParent', 2);
For code A, parent in C is right; For code B, parent is always null.