jQuery UI Widgets › Forums › Grid › Error: Cannot read property '0' of null
This topic contains 2 replies, has 2 voices, and was last updated by VitaliyST 6 years ago.
-
Author
-
Hi,
That’s the error that we get :
Uncaught TypeError: Cannot read property ‘0’ of null
at c.(fiddle.jshell.net/vitaliest/oehj7na5/13/show/anonymous function).clearfilterrow (https://jqwidgets.com/public/jqwidgets/jqx-all.js:99:49208)
at c.(fiddle.jshell.net/vitaliest/oehj7na5/13/show/anonymous function).clearfilters (https://jqwidgets.com/public/jqwidgets/jqx-all.js:99:81471)
at c.(fiddle.jshell.net/vitaliest/oehj7na5/13/show/anonymous function).updatebounddata (https://jqwidgets.com/public/jqwidgets/jqx-all.js:85:93776)
at Object.b.jqx.invoke (jqx-all.js:15)
at Object.b.jqx.jqxWidgetProxy (jqx-all.js:15)
at HTMLDivElement.<anonymous> (jqx-all.js:15)
at Function.each (jqx-all.js:8)
at init.each (jqx-all.js:8)
at init.b.fn.(fiddle.jshell.net/vitaliest/oehj7na5/13/show/anonymous function) [as jqxGrid] (https://jqwidgets.com/public/jqwidgets/jqx-all.js:15:67885)
at HTMLSelectElement.<anonymous> ((index):132)And that’s how to reproduce it :
1)Open the following JSFiddle :
https://jsfiddle.net/vitaliest/oehj7na5/13/
2)Open the second tab in jqxTabs
3)Try to change values in the dropdown (check console)In a few words – we have 2 jqxGrids in jqxTabs (2 tabs), and a dropdown. Every time a user changes the dropdown value we have to update data in the grid based on selected value. It throws an error. As soon as we disable filtering ( filterable: false, showfilterrow: false) it works. Any ideas how to fix it? I guess it’s a bug…
Hello VitaliyST,
This is an issue with the
filterrow
, so as a workaround you can disable the filter row before callingupdatebounddata
and the enable it again.
Also, note that it is not a good practice to use the same instance of data adapter for more the one grid.
And finally, it is better to initialize the grids in theinitTab
function.I have updated your Example.
Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/Hello Martin,
It works. Thanks a lot.
-
AuthorPosts
You must be logged in to reply to this topic.