Welcome Guest, Not a member yet? Register   Sign In
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>";

(This post was last modified: 03-06-2016, 07:49 AM by Wouter60.)

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).

Theme © iAndrew 2016 - Forum software by © MyBB