Django and HTMX #8 - Infinite Scroll and the hx-push-url attribute

  Рет қаралды 9,986

BugBytes

BugBytes

Күн бұрын

Пікірлер: 30
@lordAvatar
@lordAvatar 2 жыл бұрын
You're giving me homework? God damn it. Great series though, it should be way more popular.
@MrBrunoPING
@MrBrunoPING 3 жыл бұрын
I was looking forward to the next video in the series! Thanks bro, I'm loving your HMTX content.
@bugbytes3923
@bugbytes3923 3 жыл бұрын
Thanks man!
@johnsolly
@johnsolly 2 жыл бұрын
Thank you for de-mystifying HTMX! I was able to follow along and implement this on my blog.
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Glad to hear that! I’m happy the videos could help
@samerelhamdo1104
@samerelhamdo1104 2 жыл бұрын
you see what happend if user refresh tha page or open the url in new tap ?
@seydinaoumarsamabaly1806
@seydinaoumarsamabaly1806 3 жыл бұрын
GOD bless you man !!!
@repotranstech
@repotranstech Жыл бұрын
I have a question?what if you are using htmx requests in all your get requests?
@mrmuranga
@mrmuranga 2 жыл бұрын
another great piece..thanks..are you able to share how you have setup your vscode..i like that vscdoe shows you as you code along when you last changed/committed the line/area you are working on..
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks again, I'm glad you are liking the videos. For that functionality, you can install the GitLens extension in VSCode. It's handy, especially when you're working in small teams!
@nevilleotieno9638
@nevilleotieno9638 2 жыл бұрын
Lovely tutorial. However, I do have one question, if you use hx-push-url which will update the URL, what would happen if the user refreshes the page? Wouldn't it reload the partial template which will be without the extended templates?
@iloveloam276
@iloveloam276 2 жыл бұрын
I've just come across this issue. If you refresh you will get a 404 in the video. In my case I had to add an optional slug parameter (slug=none) to my view and then add path"/sampleurl/ to my URLS to actually create a view for the refresh. If I hadn't done this /sampleurl/sampleslug is in the address bar but obviously there is no view for this.
@swiftscroll
@swiftscroll 3 жыл бұрын
Perfect! Thanks a lot
@bugbytes3923
@bugbytes3923 3 жыл бұрын
Thanks Tawfiq!
@mohammadshafayethaydar1652
@mohammadshafayethaydar1652 3 жыл бұрын
Thank you this requested tutorial. Please please fix lost position when i go back to film list page from film detail page.
@flutterVerseMyanmar
@flutterVerseMyanmar 3 жыл бұрын
There is bugs. paginate_by=10 but I addedd 5 movies in my list.Therefore forloop.last is True and when I click last movie, movie detail rendered under movie list. I don't know how to solve it
@LegionLeague
@LegionLeague 2 жыл бұрын
You sir are amazing
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks :D
@alimansimov1929
@alimansimov1929 5 ай бұрын
3:36 (sorun buradan qaynaqlana biler)
@lordAvatar
@lordAvatar 2 жыл бұрын
The glitch at the end is actually 2 fold, maybe 3 fold. It loads all the film objects. And then it runs hx-get{% url 'film-list' %}?page=X at the end of that whole list. Which loads the films twice. My dumb ass solve was to load one object in films_partial and pass a true context: def films_partial(request): films = UserFilms.objects.filter(user=request.user)[0:1] context = { 'films': films, 'film_partial': True } return render(request, 'partials/film-list.html', context) Then modified film-list-elements.html to hide that newly generated element. Since it was the last element it automatically loaded as normal. {% if forloop.last %} {% else %} Now I wish i could return to the same location, could probably do it with JavaScript... of course why not just redirect to "films/" in views instead of doing all this? Again I'm learning maybe you can answer that?
@nicenaija9952
@nicenaija9952 3 жыл бұрын
I’ll like to see ajax post with a toast
@ulugbeknurjonov5226
@ulugbeknurjonov5226 3 жыл бұрын
Can you show how make scroll with table html like total and subtotal ?
@BeattapeFactory
@BeattapeFactory 2 жыл бұрын
thank you
@bugbytes3923
@bugbytes3923 2 жыл бұрын
You're welcome, thanks for commenting!
@shavakano90
@shavakano90 2 жыл бұрын
what does your film.html file have?
@bugbytes3923
@bugbytes3923 2 жыл бұрын
You can find the templates on Github: github.com/bugbytes-io/django-htmx/tree/master/Video%20%238/films/templates
@yousefpahang
@yousefpahang 3 жыл бұрын
I'm using push-url with true and it does everything : hx-push-url="true"
@johnmcway6120
@johnmcway6120 Жыл бұрын
You forgot to handle the last page. No get request needed for the last page.
@creator4666
@creator4666 2 жыл бұрын
Nc work
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Cheers.
Django and HTMX #5 - Building a Dynamic Search Component
20:32
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН
КОНЦЕРТЫ:  2 сезон | 1 выпуск | Камызяки
46:36
ТНТ Смотри еще!
Рет қаралды 3,7 МЛН
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.
django-htmx - Django Extensions for Working with HTMX
37:06
BugBytes
Рет қаралды 24 М.
Django and HTMX #15 - Click to Load pattern
15:32
BugBytes
Рет қаралды 6 М.
Django and HTMX #10 - Chained Dropdowns with Django and HTMX
12:27
Django and HTMX #4 - Deleting Items (with no refresh!)
10:46
BugBytes
Рет қаралды 15 М.
Realtime updates with next.js, socket.io and a redis publisher
16:14
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН