jQuery UI Widgets › Forums › Grid › call to refreshfilterrow error when grid is created in hidden parent
Tagged: bug, grid, hidden, jqxGrid ;, refresh filters
This topic contains 3 replies, has 2 voices, and was last updated by Hristo 5 years, 1 month ago.
-
Author
-
October 24, 2019 at 2:41 pm call to refreshfilterrow error when grid is created in hidden parent #107138
Hi!
I hope I don’t bother you with my bug reports, but I feel it’s better to report them, even when I can use a quite simple workaround to prevent them..
In our code, grids are sometimes created in a tab that is still hidden at that moment, and actions are performed on them “in the background”. So far they behave great, rows can even be selected and events triggered (even if as I’ve noticed with this bug, the grid is not visually initialized yet; actually I had trouble to find that being hidden was the condition for the error to happen).
So, when the grid is an a hidden div, and is created with
showfilterrow: true
, so far everything is OK. But if a call tojqxGrid('refreshfilterrow')
is made while still hidden, this error happens:
“TypeError: this.columns.records is undefined”You can try it here: https://jseditor.io/?key=e48ef582f66911e9a73300224d6bfcd5
Once the parent div is shown, the error doesn’t happen.Thanks by advance,
KaddathOctober 28, 2019 at 1:34 pm call to refreshfilterrow error when grid is created in hidden parent #107164Hello Kaddath,
Could you clarify it?
What is your final goal?
Because this is a refresh method and it makes transformations and does actions over the existing elements but if you setdisplay: none
it is difficult to do this.
Please, take a look at this workaround.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comOctober 28, 2019 at 3:27 pm call to refreshfilterrow error when grid is created in hidden parent #107170Thanks for the answer,
I’ll try to explain it simply, I can’t really share all the code because it’s really long: we have a wrapper class for grids that automatically plugs to a data set component with hidden “system fields” (that the data set uses internally). On creation, filters are added to these system fields and by default, our function to add filters refreshes the row (which seemed a logical thing to do, because these system columns are not always hidden -our debug mode-).
So it didn’t happen until now, but grids can be in a tab that is created but still not shown. We can’t use this workaround because that would imply to show the tab (select it), however I used another one which consists in an extra parameter to our add filter function, to optionnaly not refresh the row when the grid is in creation.
If works so far, but it just seemed to me better idea to solve the error at the source, and add an extra test to
refreshfilterrow
, something likeif(!this.columns.records){ return; }
so that there is no error in the console.. That’s why I reported here.Kaddath
October 30, 2019 at 12:32 pm call to refreshfilterrow error when grid is created in hidden parent #107195Hello Kaddath,
Thank you for this clarification.
Yes, the mentioned approach looks good.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.