raty | : star2 : Raty - A Star Rating Plugin | Frontend Framework library
kandi X-RAY | raty Summary
kandi X-RAY | raty Summary
:star2: Raty - A Star Rating Plugin
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Representation of the description
raty Key Features
raty Examples and Code Snippets
Community Discussions
Trending Discussions on raty
QUESTION
I have successfully implemented the Raty star rating in my ASP.NET Core app but I am having one issue that I can’t seem to resolve.
I am using the lib for a dual purpose (see Sample image of Raty usage):
- to show a read-only ‘Total’ rating for an entity (i.e. an Artist in the image above), and
- to allow each user to set/edit their own rating for each artist.
The data is stored in the DB and the Artist ‘Total’ rating is retrieved when the main record is retrieved. When the logged in user clicks on the ‘Total’ rating (the 5 stars on top), a bootstrap toast popup displays, retrieves the user specific rating for that artist via AJAX, and displays their last saved rating (if any). Everything works great, including saving their rating in DB if they change it and click the ‘Update’ button.
BUT... what I can’t seem to figure out is how to update the ‘Total’ Artist rating (stars on the top). The second AJAX call (when user clicks the ‘Update’ button) updates the DB and returns the newly computed ‘Artist ‘Total’ rating, but when I try to reset the stars on top to correctly display the new Artist ‘Total’ rating, nothing happens.
The funny thing is: I can use $('.userRating').data('raty').score(RatingUserVal); to reset the original user rating (when the user displays the popup, changes their rating, does NOT click update, and instead clicks the ‘X’ to close the popup). So if they click the ‘Total’ rating again, I simply reset the user rating via $('.userRating').data('raty').score(RatingUserVal); and that works great.
But when I try to do the same for the ‘Total’ rating, it doesn’t work??
Below is some relevent code so maybe someone can point me to what I’m doing wrong. This is on page load for the ‘Total’ Artist rating:
...ANSWER
Answered 2021-Aug-25 at 19:44After a great suggestion from @Yiyi You, the solution is to toggle the readOnly attribute when setting the '.rating' score. Apparently, when '.rating' is in readOnly mode, it will NOT let you reset the star display. Hence the solution is:
QUESTION
For years I have used the following js/ajax "remote: true" setup.
But now the browser is not displaying the _partial.html.erb when called by the action.js.erb.
Console does show partial is rendered but it is not visible within the browser div.
Here is a simple demo of the js/ajax "remote: true" setup using Time.zone.now:
application/_time_now.html.erb
...ANSWER
Answered 2021-Jul-01 at 11:30i think your jquery
setup (webpack
) is incorrect so $
is nil, you can easily search how to do that, e.g this
another way, you can use dom querySelector instead of jquery
QUESTION
I am beginner web developer. I make project in Bootstrap 4. I have small problem with to large space between menu items (top menu, nav) I have this code:
...ANSWER
Answered 2020-Jul-13 at 08:07Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install raty
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page