Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1086763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:51:13+00:00 2026-05-16T22:51:13+00:00

thanks for every help that you guys have given me so far !! :D

  • 0

thanks for every help that you guys have given me so far !! 😀

and now, i encounter some problem on me using jquery and ajax

i am fetching all of my user’s photos from my database, calling them out into a grid and then applying a jquery pagination plug-in ‘pajinate’ using this code

$(function(){
    $('#talent_paging').pajinate({
        num_page_links_to_display : 4,
        items_per_page : 15,
        nav_label_first : '«',
        nav_label_prev : '<',
        nav_label_next : '>',
        nav_label_last : '&raquo;'
    });
});

source: jquery.pajinate

the page is about searching using certain parameter such as: range of age, gender, and keywords
and i am using ajaxform to process the form submission, using this code

$(function() { 
    var options = { 
        target:'#talent_paging',
    };
    $('#search_talent').ajaxForm(options); 
});

source: ajaxForm

like you would have guessed, the pagination is working well on the first page load, but as soon as i operate the search, it fails me. I actually had encountered similar problem regarding this when i was using jquery datatable and was trying to manipulate each row, it was working well on the first page, but it fails on the next page.

i solved my datatable’s problem using .delegate(), and i figure that this one has the same issue, i have tried several ways on adding the delegate methods on my pagination-search problem but it was only trials without knowing what am i actually doing (copy this paste that :p) since i don’t really understand how does .delegate() works

so, please help me on these questions

is delegate the best way to solve my current problem ??

if it is, please help me on understanding how does .delegate() works

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:51:13+00:00Added an answer on May 16, 2026 at 10:51 pm

    $().delegate() only works on events, e.g. clicks, mouseovers, focuses, etc. There is a concept in Javascript called “bubbling”. This means that, unless you explicitly say otherwise, every event will “bubble” its way up the DOM tree and will be triggered on every element in the tree. This means that you can use a common ancestor element to “trap” all events of a particular type on child elements.

    This will not work, as I understand it, on the pajinate plugin, because it does not use events. I believe it modifies the document at the moment of the call.

    You need to use a callback function to call $('#talent_paging').pajinate() each time the ajaxform has finished its work:

    $(function() { 
        var options = {
            target:'#talent_paging',
            success: function() {
                $('#talent_paging').pajinate({
                    num_page_links_to_display : 4,
                    items_per_page : 15,
                    nav_label_first : '&laquo;',
                    nav_label_prev : '<',
                    nav_label_next : '>',
                    nav_label_last : '&raquo;'
                });
            }
        }
    
        $('#search_talent').ajaxForm(options); 
    });
    

    Note that this code is not excellent in terms of optimisation, but it’s hard to do that without seeing your base HTML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thanks to a library upgrade (easymock 2.2 -> 2.4), we're having tests that have
Thanks for reading this. I have markup similar to what is below. Using the
Hey guys, I have a program that allows me to run queries against a
Thanks for reading. I'm a bit new to jQuery, and am trying to make
Thanks for reading this. I am dynamically generating some data which includes a select
Thanks for a solution in C , now I would like to achieve this
thanks in advance for your help. I am wondering if there is a (design)
I was wondering if I could have some pseudo code for working out the
Thanks to Stack Overflow and you guys i successfully completed my first project (viz.
I'm writing a webapp using Zend framework and a homebrew widget system. Every widget

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.