Wednesday, April 1, 2015

Not Able to attach events on CellTable using native Javascript

Hi 
I am attaching events on cell table data using native javascript(jquery), but the events are not binding and what i have discovered is, If I use these along with setTimeout(..,10000) function, the events are binded and working properly.

This is the code i have used in UIBinder's java file.
       @Override
protected void onAttach() {
super.onAttach();
clearRequiredValidatorOnNew();
}
    
      $wnd.setTimeout(function() {
       $wnd.jQuery('.icon-pencil').click(function(e) {
if ($wnd.jQuery(this).text().trim() == ''){
$wnd.jQuery(this).closest('form').find('.reqField').each(function() {
$wnd.jQuery(this).css('background','transparent');
$wnd.jQuery(this).prev('label').removeClass('text-warning');
$wnd.jQuery(this).prev('label').children('span.reqIndic').css('visibility', 'hidden');
});
}
});
}, 1500);
Here the class .icon-pencil will reside in CellTable(data).

Please suggest how i can use this without timeout.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment