Title: treegrid - cannot read property <fieldname> of null [solved] Post by: devnull on October 26, 2017, 05:42:45 AM version is 1.44.
I have a treegrid, that has just a few columns, the data loads fine, but when I click on a leaf row, I get the easyui error: jquery.easyui.min.js:8881 Uncaught TypeError: Cannot read property 'text' of null jquery.easyui.min.js:8881 Uncaught TypeError: Cannot read property 'revn' of null jquery.easyui.min.js:8881 Uncaught TypeError: Cannot read property 'desc' of null depending on whether I click the text, revn or desc cell, actually I am not interested in cell edit, all I want to do is select the row, but easyui is stopping me: Code: else { It is failing on this line: opts.onClickCell.call(_63e, _63f, _642, row[_642]); Title: Re: treegrid - cannot read property <fieldname> of null Post by: devnull on October 26, 2017, 06:14:05 AM It seems that the row does not have an id, but why would that be ?
Code: <tr id="datagrid-row-r7-2-undefined" node-id="undefined" class="datagrid-row"><td field="text"><div style="height:auto;" class="datagrid-cell datagrid-cell-c7-text"><span class="tree-indent"></span><span class="tree-indent"></span><span class="tree-indent"></span><span class="tree-indent"></span><span class="tree-icon tree-file icon-jpg"></span><span class="tree-title">TS_P1</span></div></td><td field="revn"><div style="height:auto;" class="datagrid-cell datagrid-cell-c7-revn">A1</div></td><td field="desc"><div style="height:auto;" class="datagrid-cell datagrid-cell-c7-desc">test tt</div></td></tr> Title: Re: treegrid - cannot read property <fieldname> of null Post by: jarry on October 26, 2017, 07:00:45 AM The idField and treeField properties must be set.
Title: Re: treegrid - cannot read property <fieldname> of null Post by: devnull on October 26, 2017, 04:03:10 PM They are set:
Code: $('#folds').treegrid({ The leaf rows that are showing this problem are loaded async. Title: Re: treegrid - cannot read property <fieldname> of null Post by: devnull on October 26, 2017, 04:09:02 PM OK, I have solved this, there was no problem with the initial load of the folders, the problem was with the leafs which were loaded asyncly.
So I discovered that the leaf loading did not include the idField, hence the missing id. |