Welcome Guest, Not a member yet? Register   Sign In
paging on popup dialog --> how to refresh
#1

Dear all,

I have below code in the abcde.php. I have the button to show the popup dialog. But I do not know how to refresh the popup dialog on which there is paging. If i press paging button, how to refresh popup dialog??? as I believe it will back to abcde.php page.

Code:
    echo "<div class=\"user-ads-action\"><a  href=\"#ApprovePopup\" 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>";


//-----------footer section with popup dialog declaration-------------//

Code:
<div class="modal fade" id="ApprovePopup" tabindex="-1" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title">Approve or reject </h4>
      </div>
      <div class="modal-body">
        <table id="addManageTable" class="table table-striped table-bordered add-manage-table table demo" data-filter="#filter" data-filter-text-only="true" >
                <thead>
                  <tr>
                    <th> <?php echo $this->lang->line("From");?> </th>
                    <th data-sort-ignore="true"> <?php echo $this->lang->line("Ads_Detail");?></th>
                    </tr>
                </thead>
                <tbody>
            <?php
                if($result<>null)
                {
                    $rowCount=0;
                      foreach($result as $id=>$row)
                      {
                          ................
                          echo "<td style=\"width:55%\" class=\"ads-details-td\">";
                        echo "<div class=\"ads-details\">";
                      echo "<h5><div >".$this->lang->line("lblTitle").$previewTitle."</div>".$previewDesc;
                          echo "<br/>Posted On: ". $createDate."</h5>";
                            echo "</div></td>";
                          echo "</tr>";
                          
                      }
                }
            ?>
         <div class="pagination-bar text-center">
            <ul class="pagination">
            <?php
                $url_path=base_url().MY_PATH."getAccountPage/2";
                $pageNum2=$pageNum+1;
                $pageNum3=$pageNum+2;
                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>";

            ?>
                </ul>
          </div>
                 </tbody>
              </table>
      </div>
      
    </div>
  </div>
</div>
Reply
#2

I have tried below: But it failed. no action when click on paging --------------------//

//----- Below jquery function for being called when click on the paging below --------------//
Code:
function getApproveList(ctrlValue1, ctrlValue2, ctrlName, ctrlErrName) {
    $("#".concat(ctrlName)).html('<img alt="loading..." src="<?php echo base_url();?>assets/img/loading.gif">');
    $.ajax({
        method: "POST",
        url: "<?php echo base_url(); echo MY_PATH;?>Item/getHtmlList",
        data: { postID: 20, //$( "#".concat(ctrlValue1) ).val(),
            pageNum: 2}, //$( "#".concat(ctrlValue2) ).val()},
        success: function(response){
            var result;
            try{
            alert("1234");
            result=JSON.parse(response);
            }catch(err){
                alert(err.message);
            }
            $("#".concat(ctrlName)).html(result.icon);
            $("#".concat(ctrlErrName)).html(result.message);
            }
    });
};

//---------Paging code in controller Item of function getHtmlList---------------------------------//
Code:
$outputhtml=$outputhtml."<input type=\"hidden\" id=\"ctrlpageNum\" name=\"ctrlpageNum\" value=\"$pageNum\"/>";
                $outputhtml=$outputhtml."<input type=\"hidden\" id=\"ctrlpageNum2\" name=\"ctrlpageNum2\" value=\"$pageNum2\"/>";
                
                $outputhtml=$outputhtml."<li  class=\"active\"><a id=\"hrefPageNum\" href=\"#\" onclick=\"getApproveList(\"ctrlpostID\", \"ctrlpageNum\", \"tableBodyList\", \"tableBodyError\"); return false;\">$pageNum</a></li>";
                $outputhtml=$outputhtml."<li><a id=\"hrefPageNum2\" href=\"#\"  onclick=\"getApproveList(\"ctrlpostID\", \"ctrlpageNum2\", \"tableBodyList\", \"tableBodyError\"); return false;\">$pageNum2</a></li>";
Reply




Theme © iAndrew 2016 - Forum software by © MyBB