not rebind element already binded or flush all binded element ? #2192
Unanswered
BobSquarePants
asked this question in
Q&A
Replies: 1 comment
-
Meanwhile I came up with def NoDblBind(Cible, EvType, Fn):
if len(Cible.events(EvType)) != 0:
for each in Cible.events(EvType):
if str(each)[10:-1] != Fn:
print('Had a bind but not ' + str(each)[10:-1])
Cible.bind(EvType, Fn)
else:
print('Was already assigned to :' + str(each)[10:-1])
else:
print('Binding.')
Cible.bind(EvType, Fn)
#call the function
NoDblBind(document['something'], 'click', aFunction) If someone have documentions about |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
If I update a page (from an ajax return). and in that return I have
in order to bind new element from that ajax return. it work well.
unfortunately, at every same ajax return (if many) the reload will (of course) rebind already existing element too..
Is there a way to not rebind element to the same binded function ?
I'm using currently unbind, bind, but maybe something better exist ?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions