ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: hyh888 on September 27, 2023, 06:00:48 am
-
When the pid of the top root node in treegrid is 0( for the database in my company required that pid field couldn't be null.), the treegrid couldn't be show out.
When I tried modify the response data which come from server, it wil make a lot of trouble in select box in treegrid.
Is there any way to fix the bug?
-
root node is suppoed to have undefined pid.
0 is not the same as undefined so it's not a bug,
-
I have to make a patch like this to solve two in-build problem of tree.
function getChanges(grid) {
let list =grid.getChanges({ format: 'byVal' });
list.addList.forEach(item => {
delete item.id;
if(!item.pid)item.pid=0;
});
list.updateList.forEach(item => {
delete item.items;
if(!item.pid)item.pid=0;
});
return list;
}