Results 1 to 7 of 7

Thread: Ajax Pagination - More than one objects per page

  1. #1
    Join Date
    Aug 2008
    Posts
    13
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Ajax Pagination - More than one objects per page

    1) Script Title: Ajax Pagination script v1.2

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nate/index.htm

    3) Describe problem: I want to have more than one objects in each page, which looks like this:

    flower1

    flower2

    flower3

    flower4

    1 2 3 next

    -------------------------------
    flower5

    flower6

    flower7

    flower8

    1 2 3 next

    How can I change the number of the html files that are loaded in each page??
    Last edited by ktsixit; 08-26-2008 at 11:33 AM.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm I'm not sure I fully understand. Do you simply mean you want to display multiple instances of Ajax Pagination script on a page?
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    ktsixit (08-26-2008)

  4. #3
    Join Date
    Aug 2008
    Posts
    13
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    yes that's it, I changed the description a little to make it easier to understand. can you describe me how to do it? Is it possible?

    I really need to do this, because the script is useless for me if it shows one element per page.
    Last edited by ktsixit; 08-26-2008 at 12:12 PM.

  5. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The script certainly does support multiple instances of itself on the same page. Simply make sure all variable names used by each instance are unique. Here's the HTML code for 2 separate instances of the script:

    Code:
    <h2>Example 1</h2>
    
    <div id="paginate-top"> </div>
    <div id="bookcontent"> </div>
    <div id="paginate-bottom"> </div>
    
    
    <script type="text/javascript">
    
    var bookonflowers={
    pages: ["demofiles/flower.htm", "demofiles/flower2.htm", "demofiles/flower3.htm", "demofiles/flower4.htm"],
    selectedpage: 0 //set page shown by default (0=1st page)
    }
    
    var mybookinstance=new ajaxpageclass.createBook(bookonflowers, "bookcontent", ["paginate-top", "paginate-bottom"])
    
    </script>
    
    
    
    
    <h2>Example 2</h2>
    
    <div id="paginate-top2"> </div>
    <div id="bookcontent2"> </div>
    <div id="paginate-bottom2"> </div>
    
    
    
    <script type="text/javascript">
    
    var bookonanimals={
    pages: ["demofiles/external.htm", "demofiles/external2.htm", "demofiles/external3.htm"],
    selectedpage: 0 //set page shown by default (0=1st page)
    }
    
    var mybookinstance2=new ajaxpageclass.createBook(bookonanimals, "bookcontent2", ["paginate-top2", "paginate-bottom2"])
    
    </script>
    DD Admin

  6. The Following User Says Thank You to ddadmin For This Useful Post:

    ktsixit (08-27-2008)

  7. #5
    Join Date
    Aug 2008
    Posts
    13
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Maybe I didn't describe it well enough, I think that you didn't understand exactly. I dont need the script to have 2 instances in my page but one. That one script should just show 4 flowers of my list of external pages, then the next 4 flowers etc.

    Ok, let's say I create a list of flowers. Each flower in my list is one external html file.

    var bookonflowers={
    pages: ["flower1.htm", "flower2.htm", "flower3.htm", "flower4.htm","flower5.htm", "flower6.htm", "flower7.htm", "flower8.htm","flower9.htm", "flower10.htm", "flower11.htm", "flower12.htm"],
    selectedpage: 0 //set page shown by default (0=1st page)
    }

    the script should create 3 pages for my list, with 4 external html files loaded in each page:
    the first page should have the flowers 1-2-3-4,
    when I request to see the second page of results in the pagination menu (1,2,3, next), I should get the second page of results which contains flowers 5-6-7-8


  8. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Ah I see what you mean now. Unfortunately there's no easy way to do this without some rather extensive changes to the script. Might be something you'd want to consider posting in the "DD scripts Paid Help" section.
    DD Admin

  9. The Following User Says Thank You to ddadmin For This Useful Post:

    ktsixit (08-27-2008)

  10. #7
    Join Date
    Aug 2008
    Posts
    13
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    I just found the Virtual Pagination Script. The code of Demo 3 works fine for me, although it does not load dynamically content, but it gives an automatic way to publish content in several pages.

    I am sorry if I confused you with my bad descriptions. I am very happy that I found Virtual pagination and I dont need to mess up with javascript code. Thank you very much for your help. You are very kind

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •