Thursday 15 September 2011

jquery - javascript call after dataGrid pagination -



jquery - javascript call after dataGrid pagination -

is there way phone call js or jquery function afterwards primefaces datagrid has switched between pages , info content has changed? have set jquery function items shown on info grid, since items shown page page, have re-attach jquery function new items shown. have tried next no success;

//way #1 - phone call ajax on complete/ on success after page link has been clicked $('.ui-paginator').click(function(e) { alert("enter"); $.ajax({ success: function(data, textstatus, jqxhr) { alert("success"); $('.certain-class').attachfunction(); }, complete: function(data, textstatus, jqxhr) { alert("complete"); $('.certain-class').attachfunction(); } }); //way #2 - after content of info grid has changed, phone call function $('.ui-datagrid-content').ajaxcomplete(function() { alert("changed outside"); $('.certain-class').attachfunction(); });

the result i'm getting alerts beeing called (so, function attached) before content on datagrid changed, thought of using timeout, not desired approach.

i'm using pf 5.0 .

you can utilize ajax page event:

<p:datagrid> <p:ajax event="page" onstart="alert("ajax started");" onsuccess="alert("ajax success");" oncomplete="alert("ajax completed");" /> </p:datagrid>

jquery ajax jsf primefaces

No comments:

Post a Comment