java - Injecting JavaScript(JSNI) to Cell Table DOM -
in application using gwt cell table, of column header want add tooltip.column header created using safehtml , injecting js cell table header using jsni. time dom not creating , javascript not attaching column header tooltip.if use timer problem goes off,i don't want use timer.is there way inject js?any clue?see below code,
column header safehtml:
safehtml="<span>total</span><span title='' rel='tooltiptop' class='reqfull' data-original-title='{0}'> <i class='fa fa-info-circle'></i></span>";
jsni:
private static native void inittooltip() /*-{ $wnd.$(document).ready(function(){ $wnd.jquery("[rel=tooltiptop]").tooltip({ placement: 'top'}); }); }-*/;
i calling jsni after table creation still dom not ready. tried calling jsni script in onattach() method,
@override protected void onattach() { super.onattach(); inittooltip(); }
any suggestion?
i think scheduler may solution. add jsni start of next javascript loop.
but think there still may better solution instead of using timer or scheduler.
update
there seems error in code:
in jsni document
needs calles $doc
private static native void inittooltip() /*-{ $wnd.$($doc).ready(function(){ $wnd.jquery("[rel=tooltiptop]").tooltip({ placement: 'top'}); }); }-*/;
Comments
Post a Comment