View Full Version : [CLOSED] Store Listener: Refresh Issue

Dec 12, 2014, 1:01 PM
I have run into a odd issue in my code and was able to duplicate it in one of your examples with a modification. I am not sure if I am doing something wrong or if there is a bug.

Use the GridPanel -> Plugins -> GridFilters_Remote (http://examples2.ext.net/#/GridPanel/Plugins/GridFilters_Remote/) example and add the following listener to the store:

<Refresh Handler="#{GridPanel1}.getSelectionModel().select(0);" />

I was attempting to select the first index in the grid when the store is refreshed.

Now run the example and perform the following:

Launch Example - Grid is correct with "3m Co" selected
Sort on Date column: Grid is correct with "International Business Machines" selected
Filter on Company column using "The": Grid is correct with "The Home Depot, Inc" selected
Sort on Date column again: Error, Error ...

A javascript RangeError: Maximum call stack size exceeded is raised.

Any thoughts?

Dec 12, 2014, 8:01 PM
Hi Chris,

Please use:

<Refresh Handler="#{GridPanel1}.getSelectionModel().select(0);" Buffer="10" />

Dec 13, 2014, 8:00 PM
Great. Need to look throughout my code to see where else this might be applied. Please close the thread.

Dec 13, 2014, 9:38 PM
Buffer="10" does the two jobs. At first, it delays executing of the handler for 10 milliseconds. It should guarantee that the handler - selecting a row - won't be executed too early. At second, the handler executes once for sure even if the event fires more times than one in a row for some reason.