dzRaty is a wrapper for jQuery Raty, a plugin developed by Washington Botelho that generates a customizable star rating.
To get started, check http://yii.dezero.es/dzraty
Changelog ¶
v1.1
- Integration with CGridView as filter and data column
- Upgraded to jQuery Raty 2.5.2
v1.0
- Initial commit
Installation ¶
Requirements: jQuery and Yii framework 1.0 or above (tested on 1.1.12).
Extract downloaded file to your Yii application extensions folder (default: protected/extensions).
Usage ¶
Edit mode ¶
Using with an attribute model. weight is a sample attribute name
$this->widget('ext.DzRaty.DzRaty', array(
'model' => $model,
'attribute' => 'weight',
));
Using with a single input element
$this->widget('ext.DzRaty.DzRaty', array(
'name' => 'my_rating_field',
'value' => 3,
));
View / Read-only mode ¶
$this->widget('ext.DzRaty.DzRaty', array(
'name' => 'my_rating_field',
'value' => 3,
'options' => array(
'readOnly' => TRUE,
),
));
Localization - i18n ¶
dzRaty translates all translatable elements of jQuery Star plugin. You can place your own translation file under DzRaty/messages.
Current version contains translation files for spanish. You could simply duplicate and edit one of them.
excellent
impressive homepage (I wish all extension would have such dedicated homepage).. I'll definitly try this extension !
Good job
Thanks!
Thanks for your comments > @Raoul.
I'm thinking now about integrating it with CgridView as filter and data column.
Save User Rating
Hello,
Thank you for this extension.
My question is how to save user ratings to database?
@beesho
You have several ways to save the rating in database: using an attribute model or in a custom CForm (see examples above). If your dzRaty returns a numeric value, you should save it on a FLOAT or INT database column. Or if you configure it to return a string value, so you must use a VARCHAR or similar.
This plugin works like a normal text field. In fact, it saves the value in a hidden input text element.
Text Text Field
Hello,
I tried to use this but it just show a text field with star rating number in it instead of stars. Any ideas why?
@skworden
That's why jQuery Raty plugin isn't running for this field. I don't know the reason... maybe jQuery Raty library is not loading in HTML document. Have you checked you have write permissions in assets folder? Do you have any Javascript error in your browser console? This can give you a clue.
RE:
My js was conflicting with raty's js making the js line where it hides the field not a valid statement...got it solved thanks.
issue
break in pagination in clistview :(
@Jales Monteiro
I've never checked dzRaty in CListView.
Thanks for reporting. I'll fix it soon.
dzRaty conflicting with yii jquery.. Am using yii version 1.8
@skworden,
Please how did you resolve the dzRaty jquery confilct. I could not get it work.
Thanks
Nice work!
Rating directly on CGridView
Hi,
Could anyone please explain how we could assign rating value directly on CGridView for each item? Thank you!
action in controller for dzraty
how can i attach the extension to the action in controller, means how can i use dzraty with database.
can i use multi dzraty widget in one view
can i use dzraty many times in one view, if yes how?
dzhtml.php failed to open stream?
What is going on? What is dzhtml.php? I can't find that file :( HELP!
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.