I am a GWT person with zero jquery experience. Sorry about that. Unfortunately, I am encountering some jquery features which I have to use in my GWT project.
<script type="text/javascript">
$(document).ready(function() {
zingchart.render({
'id' : 'g1',
'width' : 500,
'height' : 400,
'dataurl' : 'scatter_minimal.txt'
});
});
</script>
<div class="g" id="g1"></div>
In my scratchy intuition, I am about to believe that
$(document).ready( ..)
should be translated as GWT's onModuleLoad(){ ....}
, where onModuleLoad would ensure that the DOM is ready, if I called that function within onModuleLoad.
But I don't think the following would be valid ..
private static native void render() /*-{
function() {
zingchart.render(
{
'id' : 'g1',
'width' : 500,
'height' : 400,
'dataurl' : 'scatter_minimal.txt'
}
);
}
}-*/;
How would I code the JSNI to define that function that I could call from GWT?