Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can use jquery-confirm with a star rating #514

Closed
tombit-sro opened this issue Apr 20, 2020 · 1 comment
Closed

I can use jquery-confirm with a star rating #514

tombit-sro opened this issue Apr 20, 2020 · 1 comment

Comments

@tombit-sro
Copy link

tombit-sro commented Apr 20, 2020

jquery-confirm version:
v3.3.4

I'm submitting a ... (check one with "x")
[ ] bug report
[ ] feature request
[x] support request

Can I use jquery-confirm to make rating stars work, or any equivalent of rating?
Similar to the link below:
https://codepen.io/mmoradi08/pen/yLyYrGg

Thanks
Thomas

@tombit-sro
Copy link
Author

It's already working
If it suits someone, they write the code below

`$('.btnRating').on('click', function(){
var lid = $(this).data('id');
var valrat;

$.confirm({
title: 'Rating',
content: '

',
buttons: {
Save:{
btnClass: 'btn-success',
action: function(){
valrat = $("#rateYo").rateYo("rating");
$.nette.ajax({
type: "POST",
dataType: "json",
url: {link changeRating!},
data: {"id": id,"ob": valrat}
});
}},
Delete:{
btnClass: 'btn-danger',
action: function(){
valrat = $("#rateYo").rateYo("rating");
$.nette.ajax({
type: "POST",
dataType: "json",
url: {link changeRating!},
data: {"id": id,"ob": 0}
});
}},
Cancel: function(){
//$.alert('Canceled!');
}
},
onContentReady: function () {
$("#rateYo").rateYo({
starWidth: "40px",
fullStar: true
});
}
});
});`

God luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant