Welcome Guest, Not a member yet? Register   Sign In
Simple Ajax paging with existing pagination lib & jQuery
#14

[eluser]Fumigator[/eluser]
Here's a change I recommend for anyone wanting to get this all working. Instead of using the "onclick" as the OP demonstrates, assign the anchor elements to a class:

Code:
if($this->is_ajax_paging == TRUE)
        {
            $paging_function = ' class="pagecontrol"';
        }
        else{
            $paging_function = '';
        }

You can then use a simple jQuery selector to detect when a paging control anchor is clicked and react to it. Here's mine:

Code:
$('.pagingcontrol').live('click', function()
{
  $.ajax({
  type: "GET",
  url: $(this).get(),
  success: function(html) {
   $('#content_box').html(html);
  }
  });
  return false;
});


Messages In This Thread
Simple Ajax paging with existing pagination lib & jQuery - by El Forum - 02-11-2012, 07:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB