Pagination in JavaScript

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

Комментарии • 81

  • @DEBO5
    @DEBO5 2 года назад +1

    The perfect pagination tutorial

  • @yoselyncallejas7913
    @yoselyncallejas7913 4 года назад +9

    This video is seriously so underrated. Thanks a bunch! It helped me a lot. The only thing I'm missing is the prev. and next buttons, I will try and figure it out.

  • @fiction-bo3if
    @fiction-bo3if 3 года назад +2

    works perfectly. Made a few adjustments to my own project but after following your explanation it's finally working as intended. Thank you.

  • @FrankUnderwoood
    @FrankUnderwoood 3 года назад +5

    Thanks to this tutorial I've finally figured out how to implement a working pagination! 😃Thank you!

  • @--VICKY-
    @--VICKY- 3 года назад +3

    thank you, I thought it might be tooooo hard to implement. but you way of teaching and clarity explanation made it easier. once again thank you keeeep teaching

  • @erickbuitrago7555
    @erickbuitrago7555 3 года назад +2

    Muchas gracias, hombre! No pude entender lo que decías debido a que no sé inglés, pero pude implementarlo en mi proyecto. Agradecido contigo

  • @oeddsprimers4217
    @oeddsprimers4217 5 лет назад +4

    Excellent tutorial vid... everything works by the end (Jan-004-2020)
    - well done, cheers, and thanks Tyler

  • @jamespaulchibole266
    @jamespaulchibole266 Год назад +1

    Thank you for the posting. It is very helpful.

    • @TylerPotts
      @TylerPotts  Год назад

      Glad it was helpful!

    • @jamespaulchibole266
      @jamespaulchibole266 Год назад

      @@TylerPotts Thank you, I am now struggling to fetch the data for pagination from a query in database. Any suggestion, pointers or help will be appreciated.

    • @jamespaulchibole266
      @jamespaulchibole266 Год назад

      A got a solution, no warries.

  • @mandy2481
    @mandy2481 4 года назад +7

    Thank you so much for this video! This really helped me for my project!

  • @ТатьянаГукова-и4с
    @ТатьянаГукова-и4с 3 года назад +1

    БОЖЕ ЧУВАК СПАСИБО!!!!!!! ПРОСТО СПАСИБО ТЕБЕ!!!!!!!!!!!!

  • @jonathonsong3513
    @jonathonsong3513 4 года назад +3

    You sir are a great teacher thanks for the help made it really easy to understand was searching for other alternatives for the language i was actually using but ended up going off of your methods thanks to you being able to break it down so easy thank you for giving back to the community

  • @StrrUe
    @StrrUe 5 лет назад +11

    thank you! after hours and hours of googling i finally came across this video and it helped me so much

    • @TylerPotts
      @TylerPotts  5 лет назад

      Happy to help!

    • @coltencoleman5513
      @coltencoleman5513 3 года назад

      a tip: you can watch movies at Flixzone. I've been using them for watching loads of movies these days.

    • @ayaancallan2716
      @ayaancallan2716 3 года назад

      @Colten Coleman Definitely, I've been watching on Flixzone for since november myself :)

  • @anahitharutyunyan3066
    @anahitharutyunyan3066 2 года назад +2

    Thank you for your clear explanation. It helps me do my project.

  • @miguelship3
    @miguelship3 4 года назад +2

    Awesome dude!! I had to figured it out how to do the same on react and it worked perfectly, thanks for the enlightment!

  • @ahakanyildiz
    @ahakanyildiz 4 года назад

    I thought you were having seizure at 08:27 mate. I don't understand how you guys understand this accent. Thanks for the well working tutorial.

  • @AshutoshNigam68
    @AshutoshNigam68 4 года назад +2

    Thanks for sharing, this is a life saver.

  • @AsimYilan
    @AsimYilan 4 года назад +1

    best Tutorial what i watched. thx a lot

    • @TylerPotts
      @TylerPotts  4 года назад +1

      Glad it helped!

    • @AsimYilan
      @AsimYilan 4 года назад

      @@TylerPotts I Love your script but i have a big porblem and hope you can help me.
      Your list_itens looks "Item 1", "Item 2", "Item 3".....
      But when i try your script with JSON i cant use it.
      I get this JSON encoded from PHP on MySQL Database with echo json_encode($data);
      i catch this with ajax get but i cant run this on your script. In console.log i can see the index in JSON data
      What must i do. I need your help

  • @carlosz1858
    @carlosz1858 3 года назад +1

    thanks bro, i was able to set up my first pagination, even though i had to watched it more than twices 😂, greetings 👍

  • @WzrLvDJ666
    @WzrLvDJ666 2 года назад

    gracias por enseñar este tema de paginacion esta muy bien la logica para sacar este proyecto

  • @SuperCodepk
    @SuperCodepk 2 года назад

    Thank you, man!

  • @harishvithal584
    @harishvithal584 3 года назад +1

    Thank you so much sir, this is so helpfull, it helped me alot!

  • @sandorferenc3101
    @sandorferenc3101 2 года назад

    Thank you very much! :D

  • @jgonz8394
    @jgonz8394 2 года назад

    what did you do that the item boxes show up? did the script exactly and nothing in my html or css that i update can make the item boxes show up.

  • @giorgosstergiou2492
    @giorgosstergiou2492 Год назад

    RESPECT!!!

  • @FrankGP.Systems
    @FrankGP.Systems 2 года назад

    Thankyou Very much

  • @dmalvi2002
    @dmalvi2002 3 года назад +1

    You literally saved my ass!

  • @jslover3687
    @jslover3687 2 года назад

    Thanks, this video is wonderful! What color theme do you use?

  • @saigudigunta9683
    @saigudigunta9683 3 месяца назад

    thanks a lot bro

  • @sunnie8460
    @sunnie8460 3 года назад

    Hi, at the end of the page when there are only a few items left, the pagination bar got pushed up. How to fix this?

  • @lonleybeer
    @lonleybeer 3 года назад +1

    How do you do it with an API?

  • @Aditya-ch6dk
    @Aditya-ch6dk 3 года назад

    Helpful...bro can you tell how we can loop trough JSON data? as in video you have just used an Array...

  • @rugambajesus3644
    @rugambajesus3644 2 года назад

    Hi is there any way of showing maybe like 1to 6 button and show other as you click, thanks!!

  • @masoudanaraki8881
    @masoudanaraki8881 2 года назад

    thank a million time body :)))))))

  • @suvineetsingh8140
    @suvineetsingh8140 2 года назад

    I have an error informing items.slice(start, end) is not a function.

  • @alvingultiano7513
    @alvingultiano7513 2 года назад

    can you do pagination by div not by items ?

  • @GrahamRSteele
    @GrahamRSteele 4 года назад

    This is awesome. An absolutely great tutorial. One question though. When you created the PaginationButton function and added the 'current_page' variable, I noticed that it wasn't declared in that function, nor was it passed to the function. I thought that, for sure, this wasn't going to work. But it did in yours and not in mine. What gives?

    • @GrahamRSteele
      @GrahamRSteele 4 года назад

      Nevermind! Got it. Firstly, I had the constants and current_page in a jQuery document.ready tag. I also had the functions above the constants and lets. Duh.

  • @nolose6542
    @nolose6542 3 года назад

    thanks u !!

  • @arjunm1205
    @arjunm1205 4 года назад

    Can you share your wallpaper? Love it

  • @mahyarazad
    @mahyarazad 4 года назад

    Thank you so much for your nice and insightful tutorial. I should say I am a newbie in JS, anyhow, I have added two functions for "Next" and "PREV". I guess they are working properly among the other functions.
    adding the buttons inside the SetupPagination():
    let next = document.createElement('button');
    next.id = "next";
    let prev = document.createElement('button');
    prev.id = "prev"
    var s = document.getElementsByTagName('button')[0]
    prev.innerText = 'Previous';
    next.innerText = 'Next';
    wrapper.insertBefore(prev,s);
    Next and Prev Functions:
    function nextp (page,items,rows){
    let page_count = Math.ceil(items.length/rows);
    document.getElementById("next").addEventListener('click', () => {
    let page = document.querySelector(".active");
    if(parseInt(page.id) === page_count ){
    } else {
    current_page = parseInt(page.id) + 1;
    DisplayList(items, list_element, rows, current_page);
    page.classList.remove('active');
    let pop = document.getElementById(current_page);
    pop.classList.add('active');
    }
    });
    }
    function prevp (page,items){
    document.getElementById("prev").addEventListener('click', ()=> {
    let page = document.querySelector(".active");
    if (parseInt(page.id)===1){
    } else {
    current_page = parseInt(page.id) - 1;
    DisplayList(items, list_element, rows, current_page);
    page.classList.remove('active');
    let pop = document.getElementById(current_page);
    pop.classList.add('active');
    }
    });
    }

    • @CrazyFanaticMan
      @CrazyFanaticMan 3 года назад

      It didn't work for me, can you link your github so I can check out the code please and thank you

  • @windrider0429
    @windrider0429 4 года назад

    how do you limit the number of pages you see? for example 1...456...10.

    • @windrider0429
      @windrider0429 4 года назад

      Also how do you create a first and last page? I can't figure it out. by the way I'm just a novice.

    • @rugambajesus3644
      @rugambajesus3644 2 года назад

      Hi, have you managed to implement the page limit

  • @paolacintolesi4150
    @paolacintolesi4150 3 года назад

    Thank you very much, it was very useful to me. Please, I need to implement the same pagination but inside some tabs, and I'm losing the current tab when I change the page number.... Please, anyone does know how could I fix it?, or Where could I find information? Thank you so much...

  • @mustapha_musah
    @mustapha_musah 3 года назад

    Wao! so helpful. I am trying to replace the "list_item" content with object-object items in the JS file but my end result was blank, Tyler I need your help😟.
    example:
    const myQuestions = [
    {
    question: "Who invented JavaScript?",
    answers: {
    a: "Douglas Crockford",
    b: "Sheryl Sandberg",
    c: "Brendan Eich"
    },
    correctAnswer: "c"

  • @AndrewB0
    @AndrewB0 4 года назад +2

    Would you think this could be used if the content was already on the page?
    Text, images and all types of fun!
    Text, images and all types of fun!
    Text, images and all types of fun!

    • @AndrewB0
      @AndrewB0 4 года назад +1

      Also this is great! Just having trouble wrapping my mind around how I want to tweak for my needs, but I keep coming back to your video..

    • @TylerPotts
      @TylerPotts  4 года назад

      I hope it helps but I'm not sure, I think you could use it? :)

  • @theoligarchist1503
    @theoligarchist1503 4 года назад +2

    CSS destroyed this demo, it gets in the way. i am newbie and this makes me wonder how to avoid CSS, unreadable code.

  • @buran_7
    @buran_7 3 года назад

    Тот случай когда понял язык не зная его

  • @xlMoiSt
    @xlMoiSt 5 лет назад +8

    You could probably just skip the HTML/CSS on tutorials like these.

    • @TylerPotts
      @TylerPotts  5 лет назад +10

      I agree but I feel like if I skip the HTML/CSS then someone will complain that I didn't do it... :)

    • @michalolos1715
      @michalolos1715 4 года назад +1

      @@TylerPotts better to create time-stamp to jump over the html/css for each likes :) i like your job, thanks :)

  • @kamalsharma2839
    @kamalsharma2839 2 года назад

    I don't know why most liked the video but to me video is like just copying pasting the youtuber code and straightway get a working code (pretty much like we already can from forums or searches) as only few things were explained, rest were just straightway writing without explanation. I simply didn't like the video

  • @travel_ghost22
    @travel_ghost22 5 лет назад

    i came here just for the JS logic and it is really sad that although tutorial was good but because you speak sofast I stopped in middle of the video and wrote this comment and one more suggestion is where you are writing a logic please explain it clearly you speak fast and frequently change the things

    • @SohCahToa30
      @SohCahToa30 4 года назад

      Pause, rewind, and adjust playback speed.

  • @greob
    @greob 4 года назад +3

    Thanks for sharing this, you make it look simple and straight-forward.