I'm using jquery mobile filter to filter table in visualforce page when page loaded the filter works great but after table rerendered the filter stopped working can anyone help me with a solution thanks

  • You will have re-bind the elements on reRender. Will be able to help better if you share the code that you're using.
    – Sam
    Sep 15 '16 at 9:50

It is common to have JavaScript that runs when a page loads, including JavaScript that applies jQuery to DOM elements. When part of a page is re-rendered, that code does not automatically run again (unless it is within the part of the page that is re-rendered).

To help with this, several Visualforce tags have oncomplete attributes where you can call some JavaScript to run when the AJAX request is complete. Organize your code like this to make use of that:


// Call this from oncomplete
function addHanders() {
    // Put your jQuery logic in here

// Execute function when page loaded


From your comment, it sounds like jquery.mobile-1.4.5.js applies logic to the DOM as it executes. If that really is the case, include it within the area that is re-rendered so that it executes again when the re-render is done. You will need to use <script> tags rather than <apex:includeScript> (which puts the JavaScript in the <head> part of the page):

<script src="{!URLFOR($Resource.FTN_JqueyMobile, 'jquery.mobile-1.4.5/jquery.mobile-1.4.5.js')}"></script>

(Rahul Sharma - thanks for the edit suggestion - think the above is probably more relevant instead given the OP's comment.)

  • Thanks Keith, Really the jquery code not appears in the page, I'm using : <apex:includeScript value="{!URLFOR($Resource.JqueryScripts, 'jquery-1.8.0.js')}"/> <apex:includeScript value="{!URLFOR($Resource.FTN_JqueyMobile, 'jquery.mobile-1.4.5/jquery.mobile-1.4.5.js')}"/> to include jquery library in my page Sep 15 '16 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.