Ajax update element with unread_count and max number of notifications to display
See original GitHub issueHi, I recently discover this awesome module but I have a few questions:
I saw that the json response with notifications contains: “unread_count”: 1 so I was wondering if it’s possible to update a count in a notification icon on top bar (like facebook globe and it’s count) with that response, or it’s necessary to modify the ajax function updateSuccess() ?
Also I was wondering if it’s possible to set a limit of notifications to display in the box, like the latest 5 notifications, or also it’s necessary to modify the notification_update() function in views.py to add a range in the line:
new_notifications = request.user.notifications.filter(id__gt=last_notification).active().prefetch()
or do that on jQuery scripts?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Update notifications via Ajax - jquery - Stack Overflow
Let's say you have a div somewhere that contains that information. <div id="unreadNotification" > ...
Read more >How to count number of notification on an icon?
Bootstrap provides us with badges to display counts on an icon which can be used to show unread notifications/messages etc.
Read more >Creating Real Time Notification System in PHP and AJAX
In this article, I will show you how to create a simple notification system by using PHP and AJAX. I will also use...
Read more >ASP.NET MVC - Using Ajax Helpers with Razor Partial Views
An empty HTML element is used as the target for the Ajax action that renders either the e-mail address or postal address partial...
Read more >An Ajax page update mini-tutorial - Daniel Nouri
Well, when we update our <div id="message"> through Ajax, the notifications pop-up won't display. This is because the document ready handler ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for you answers and the great work with this module. I also noticed that if there is no notification and your receipt one while you open the dropdown box(in: notifications/all ) adds the new notification but doesn’t remove the message: No notifications yet.
I also noticed that if there is no notification and your receipt one while you open the dropdown box(in: notifications/all ) adds the new notification but doesn’t remove the message: No notifications yet.
Yes, this should be fixed