omkar mhaiskar

omkar mhaiskar

  • NA
  • 15
  • 667

jquery boostrap paginate js plugin modification for pager po

Sep 7 2017 4:18 AM
Hi All,
 
Currently i am working on one jquery plugin. below is the plugin. http://www.jqueryscript.net/other/Easy-Any-Content-Pagination-Plugin-jQuery-Paginate-js.html

using above plugin i have generated the dynamic list of ul using below code.
 
 
  1. function FetchData() {  
  2. $.ajax({  
  3. ......  
  4. success: function (r) {  
  5.   
  6.   
  7.     $.each(JSON.parse(data), function (key, result) {  
  8.             // appending data in ul.   
  9.         }  
  10.         });  
  11.         Called Another function for pagination which is as per above plugin.   
  12.             SetPaginate();  
  13.         }  
  14.     });}  
  15.       
  16.       
  17.   
  18.   
  19.   
  20.   
  21. function SetPaginate() {  
  22.   
  23.     $('#locationdata').paginate({  
  24.         perPage: 20,  
  25.         autoScroll: true,  
  26.         //paginatePosition: ['bottom'],  
  27.         useHashLocation: true  
  28.     });  
  29.   
  30. }  
  31.   
  32. ////below is my page design  
  33.   
  34. <div class="DivwithScroll" id="divresultdata">  
  35.           
  36.         <ul id='example'>  
  37.         </ul>  
  38.         //Currently data pager is appering here as per plugin.   
  39.  </div>  
  40.     <div id="datapager">   
  41.     // I Want to add it pager here instead of example which is comes after Ul.    
  42.     </div>  
  43.   
  44. /// Css  
  45.  <style>  
  46.         .DivwithScroll {  
  47.             border: 2px solid black;  
  48.             background-position: center;  
  49.             background-size: cover;  
  50.             background-repeat: no-repeat;  
  51.             margin: 0 -2px -2px 0;  
  52.             height: 360px;  
  53.             overflow-y: auto;  
  54.         }  
  55. <style> 
 I am looking data pager of plugin outside ul parent div. have to separate out from plugin. Can anyone help me to seprate out data pager from ul list. in seprate div. I have check paginate js code .

***** js file**** This is some thing code written in js file.
 
  1. var paginationHTML = generatePagination(); //generate HTML for pagination  
  2.   
  3.             if($.inArray('top', plugin.settings.paginatePosition) > -1) {  
  4.                 $element.before(paginationHTML);  
  5.             }  
  6.   
  7.             if($.inArray('bottom', plugin.settings.paginatePosition) > -1) {  
  8.                 $element.after(paginationHTML);  
  9.             }  
  10.   
  11. ***** Js file code end here ****** 
 
 Please help me thanks in advance.
 
Omi....

Answers (1)