Closed GoogleCodeExporter closed 9 years ago
The topic "grid_compelete" is defined by your self. You can simply define it
globally or check if it is already subscribed.
Original comment by johgep
on 28 Apr 2014 at 12:50
Yes I have defined it my self, How can I find if it is already subscribed?! is
there any isSubscribed available?!
Original comment by afattah...@gmail.com
on 10 May 2014 at 5:39
See line 242:
https://code.google.com/p/struts2-jquery/source/browse/trunk/struts2-jquery-plug
in/src/main/resources/template/js/plugins/jquery.subscribe.js
Another way is to destroy this topic and recreate it. In case of the topic is
differnet then the already existing.
Original comment by johgep
on 13 May 2014 at 6:40
Thanks I tried below:
<sjg:grid id="gridtable"
onBeforeTopics="before_grid_load" >
And
$.subscribe('before_grid_load', function(event, data) {
if ( $('#gridtable').isSubscribed('before_grid_load') ){
return ; }
//go on with function
}
but $('#gridtable').isSubscribed('before_grid_load') always return false!
Original comment by afattah...@gmail.com
on 17 May 2014 at 6:57
Please see
http://stackoverflow.com/questions/23708551/struts-2-jquery-plugin-issubscribe-n
ot-working
and
http://stackoverflow.com/questions/20441178/struts-2-jquery-subscribe-is-called-
more-than-once
//instead of $.subscribe('before_grid_load' !!
$("#gridtable").subscribe('before_grid_load', function(event, data) {
//do some thing - will be called only once
}
or kill the topic (which I do not prefer it myself)
$.subscribe('before_grid_load', function(event, data) {
//do some thing
$.destroyTopic('before_grid_load');
}
Original comment by afattah...@gmail.com
on 17 May 2014 at 3:40
Original issue reported on code.google.com by
afattah...@gmail.com
on 23 Apr 2014 at 11:23