eddysilvamendes / jquery-star-rating-plugin

Automatically exported from code.google.com/p/jquery-star-rating-plugin
0 stars 0 forks source link

Rating lost after AJAX Postback #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add jQuery Rating control and set radio buttons to be the class of
"star". Everything works great.
2. After an ASP.NET ASYNC Postback the rating control changes back to radio
buttons. If we call the function again (i.e.
jQuery('input[type=radio].star').rating();) then it clears out (doesn't
show radio buttons or stars then). 

This doesn't happen if AJAX isn't installed.

What is the expected output? What do you see instead?

What version of the plugin/jQuery are you using?
PLUGIN VERSION: 3.12

On what browser(s) or operating system?
BROWSER(S): Both IE and FireFox

Feel free to provide any additional information below.

Original issue reported on code.google.com by dataspri...@gmail.com on 26 Sep 2009 at 9:34

GoogleCodeExporter commented 8 years ago
Any ideas? 

Original comment by dataspri...@gmail.com on 10 Oct 2009 at 11:20

GoogleCodeExporter commented 8 years ago
I am facing the same issue as I am using ajax for showing the result. I think 
rating
file is not getting reloaded due to browser's caching feature. This is creating 
real
big problem for me please help.

Original comment by pankaj.k...@gmail.com on 8 Feb 2010 at 6:08

GoogleCodeExporter commented 8 years ago
Yes... I don't think its related to the caching actually. I think something that
initiates isn't getting kicked off after an ASYNC postback.

Does your's show up empty or as radio buttons?  On mine.. It shows up as radio
buttons, then if I re-run the jQuery initialize script it makes the radio 
buttons
disappear. 

Anyone else having this issue?

-Chad

Original comment by dataspri...@gmail.com on 8 Feb 2010 at 9:10

GoogleCodeExporter commented 8 years ago
<script type="text/javascript">
    function EndRequestHandler(sender, args)
    {
        jQuery('input[type=radio].star').rating();
    }

    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
</script>

Original comment by smile.r...@gmail.com on 11 Feb 2010 at 12:53

GoogleCodeExporter commented 8 years ago
Did you try this? I ask because I originally thought this as well and I tried 
it but
without any luck. I have done similar EndRequestHandlers to reinitialize other 
jQuery
scripts however in this case what I end up with is a blank rating control. 

Recap:
1. Initially every works great and as expected. It also works great when not 
AJAX
/Update Panel is used.
2. After an AJAX postback, if I don't have the code you listed above then shows 
radio
buttons after a postback 
3. If I do have the code you posted, then I see no radio buttons but I also see 
no
stars or anything. Its almost as if after a postback the stylesheet options are 
lost
or something. Even if I run the  jQuery('input[type=radio].star').rating(); in
FireBug for FireFox I get the same results, all looks empty. I did confirm that 
other
styles are kept so the stylesheet is still there after a postback, just not 
rendering
properly.

Any other ideas please let me know!

-Chad

Original comment by dataspri...@gmail.com on 11 Feb 2010 at 4:29

GoogleCodeExporter commented 8 years ago
I put the css and script inside an ascx.  On postback the stars appeared.  If I 
put the css and script in the actual page it did not work in asp.net on 
postback.  I am not using updatepanel just JQuery.  The stars now show up fine 
in the page.

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ctrl_x.ascx.vb" 
Inherits="ctrl_x" %>

<link rel="stylesheet" type="text/css" href="jquery.rating.css" />
<script src="Script/jquery.rating.pack.js" type="text/javascript"></script>

Rob
www.formthis.com
Your Forms, Your Way, Today!

Original comment by eformx@gmail.com on 13 Oct 2010 at 3:06

GoogleCodeExporter commented 8 years ago

Original comment by diego.a...@gmail.com on 23 Feb 2013 at 5:12