ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: lgauton on May 14, 2014, 02:03:09 pm
-
Hi Hope you can help with this problem. I have GridA that populates GridB using a rowselect function, then GridB populates a form again based on a rowselect function. First time round all works correctly, but on second rowselect of GridB the function fires twice once based on the row data from the first selection (checked by capturing the value held in ui.rowData[0]) and then for the correct value (again checking value ui.rowData[0]), this continues for third (this times fires 3 times), fourth (this time fires four times) etc.
Closing browser and starting again just repeats above process
-
lgauton
It looks like you are binding to rowSelect event multiple times.
If you are not able to resolve it, please post a small but complete test case so that we can test it on our end.
-
Thanks
I do 'destroy' GridB each time it is populated from a GridA selection, my assumption here is that 'destroy' does just that so I cannot see that I would be binding to rowSelect event multiple times
-
Any events bound to the element using below format are not removed by destroy.
$( '.selector' ).on( 'pqgridrowselect', function (evt, ui ){ } );
//or
$( '.selector' ).bind( 'pqgridrowselect', function (evt, ui ){ } );
Either change the binding into an option callback format or don't use destroy.