Ver Mensaje Individual
  #4 (permalink)  
Antiguo 24/12/2010, 13:16
Ojete
 
Fecha de Ingreso: agosto-2010
Ubicación: Oakland california
Mensajes: 393
Antigüedad: 13 años, 9 meses
Puntos: 3
Respuesta: Paginador php?

hola gracias por las respuestas, bueno estube mirando y el paginador que mensiono tiene una variable js que se llama members que es un archivo members.js el cual contiene esto:

members.js
Código Javascript:
Ver original
  1. var members = [
  2.     ['Fred G. Aandahl', '1951-1953', 'North Dakota', 'Republican', '1897-1966'],
  3.     ['Watkins Moorman Abbitt', '1948-1973', 'Virginia', 'Democratic', '1908-1998'],
  4.     ['Amos Abbott', '1843-1849', 'Massachusetts', 'Whig', '1786-1868'],
  5.     ['Jo Abbott', '1887-1897', 'Texas', 'Democratic', '1840-1908'],
  6.     ['Joel Abbott', '1817-1825', 'Georgia', 'Democratic-Republican', '1776-1826'],
  7.     ['Josiah Gardner Abbott', '1876-1877', 'Massachusetts', 'Democratic', '1841-1891'],
  8.     ['Nehemiah Abbott', '1857-1859', 'Maine', 'Republican', '1804-1877'],
  9.     ['James Abdnor', '1973-1981', 'South Dakota', 'Republican', '1923-'],
  10.     ['Pete Abele', '1963-1965', 'Ohio', 'Republican', '1916-2000'],
  11.     ['James Abercrombie', '1851-1855', 'Alabama', 'Whig', '1795-1861'],
  12.     ['John Abercrombie', '1913-1917', 'Alabama', 'Democratic', '1866-1940'],
  13. ];






y se usa asi:
Código Javascript:
Ver original
  1. <script type="text/javascript" src="members.js"></script>
  2.        
  3.         <script type="text/javascript">
  4.            
  5.             // This file demonstrates the different options of the pagination plugin
  6.             // It also demonstrates how to use a JavaScript data structure to
  7.             // generate the paginated content and how to display more than one
  8.             // item per page with items_per_page.
  9.                    
  10.             /**
  11.              * Callback function that displays the content.
  12.              *
  13.              * Gets called every time the user clicks on a pagination link.
  14.              *
  15.              * @param {int}page_index New Page index
  16.              * @param {jQuery} jq the container with the pagination links as a jQuery object
  17.              */
  18.             function pageselectCallback(page_index, jq){
  19.                 // Get number of elements per pagionation page from form
  20.                 var items_per_page = $('#items_per_page').val();
  21.                 var max_elem = Math.min((page_index+1) * items_per_page, members.length);
  22.                 var newcontent = '';
  23.                
  24.                 // Iterate through a selection of the content and build an HTML string
  25.                 for(var i=page_index*items_per_page;i<max_elem;i++)
  26.                 {
  27.                     newcontent += '<dt>' + members[i][0] + '</dt>';
  28.                     newcontent += '<dd class="state">' + members[i][2] + '</dd>';
  29.                     newcontent += '<dd class="party">' + members[i][3] + '</dd>';
  30.                 }
  31.                
  32.                 // Replace old content with new content
  33.                 $('#Searchresult').html(newcontent);
  34.                
  35.                 // Prevent click event propagation
  36.                 return false;
  37.             }
  38.            
  39.             // The form contains fields for many pagiantion optiosn so you can
  40.             // quickly see the resuluts of the different options.
  41.             // This function creates an option object for the pagination function.
  42.             // This will be be unnecessary in your application where you just set
  43.             // the options once.
  44.             function getOptionsFromForm(){
  45.                 var opt = {callback: pageselectCallback};
  46.                 // Collect options from the text fields - the fields are named like their option counterparts
  47.                 $("input:text").each(function(){
  48.                     opt[this.name] = this.className.match(/numeric/) ? parseInt(this.value) : this.value;
  49.                 });
  50.                 // Avoid html injections in this demo
  51.                 var htmlspecialchars ={ "&":"&amp;", "<":"&lt;", ">":"&gt;", '"':"&quot;"}
  52.                 $.each(htmlspecialchars, function(k,v){
  53.                     opt.prev_text = opt.prev_text.replace(k,v);
  54.                     opt.next_text = opt.next_text.replace(k,v);
  55.                 })
  56.                 return opt;
  57.             }
  58.            
  59.             // When document has loaded, initialize pagination and form
  60.             $(document).ready(function(){
  61.                 // Create pagination element with options from form
  62.                 var optInit = getOptionsFromForm();
  63.                 $("#Pagination").pagination(members.length, optInit);
  64.                
  65.                 // Event Handler for for button
  66.                 $("#setoptions").click(function(){
  67.                     var opt = getOptionsFromForm();
  68.                     // Re-create pagination content with new parameters
  69.                     $("#Pagination").pagination(members.length, opt);
  70.                 });
  71.  
  72.             });
  73.            
  74.         </script>

Y lo que quisiera saver es si se puede usar php y mysql para mostrar datos, y si es asi, como seria?? gracias...