• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
paging on popup

Dear all,

I have below code to show popup.
echo "<div class=\"user-ads-action\"><a  href=\"#sellerApprovePopup\" data-toggle=\"modal\"  data-id=\"$postID\" data-pagenum=\"$pageNum\"  class=\"btn btn-default btn-block directSendButton\"> <i class=\" icon-pencil\"></i> Approve Request </a></div>";

And I have paging on popup, how to handle the paging? I really do not have idea as it needs to refresh the content and show popup.

div class="modal fade" id="sellerApprovePopup" tabindex="-1" role="dialog">

  <div class="modal-dialog">
    <div class="modal-content">
                      foreach($result as $id=>$row)
             <div class="pagination-bar text-center">
            <ul class="pagination">
                    echo "<li><a class=\"pagination-btn\" href=\"#sellerApprovePopup\" data-toggle=\"modal\"  data-id=\"$postID\" data-pagenum=\"$pageNumPrev\">Previous</a></li>";
                echo "<li  class=\"active\"><a href=\"#sellerApprovePopup\" data-toggle=\"modal\"  data-id=\"$postID\" data-pagenum=\"$pageNum\">$pageNum</a></li>";
                echo "<li><a href=\"#sellerApprovePopup\" data-toggle=\"modal\"  data-id=\"$postID\" data-pagenum=\"$pageNum2\">$pageNum2</a></li>";
                  echo "<li><a href=\"#sellerApprovePopup\" data-toggle=\"modal\"  data-id=\"$postID\" data-pagenum=\"$pageNum3\">$pageNum3</a></li>";

If you don't want the page to be refreshed, you have 2 options.
1. Load all records in hidden divs, and make the one that is the current record, visible. You will need jQuery for that, but then again: what's a website without jQuery nowadays?
2. Use AJAX to refresh the contents of the div in your pop-up only. In that case, jQuery also makes life much easier, since it has a few powerful functions to make AJAX requests. From the AJAX function in your view, you call the controller/method that returns the new data. And jQuery takes care of updating the DOM (i.e. the HTML-document).

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.