This is a migrated thread and some comments may be shown as answers.

RadRating becomes read only and losses style after postback using a Modal popup

1 Answer 52 Views
Rating
This is a migrated thread and some comments may be shown as answers.
Young
Top achievements
Rank 1
Young asked on 04 Feb 2015, 06:52 PM
I have a RadRating on a page that if clicked runs javascript that opens a modal.  The modal pop-up contains a "separate" RadRating module.  Everything work fine until the form on the modal popup is submitted.  This asp:Button-based submission saves to db; generates a postback; and runs javascript that hides the modal.  

What javascript do I need to use to reload my RadRating after postback from a Foundation 5 reveal modal popup? (more about modal http://foundation.zurb.com/docs/components/reveal.html)


var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function () {
      // What do I put here to re-initialize the RadRating on the main page? 
});

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 09 Feb 2015, 02:55 PM
Hi Chong,

Most probably the postback you generate is a partial one, since closing the popup and reloading the RadRating on the page is needed.

If this is your scenario, you can use a RadAjaxManager control in order to trigger the AJAX request and declare the rating on the page as updated control in the settings of RadAjaxManager, which will result in updating the rating when an AJAX request is initiated.

To demonstrate this approach, I created a sample that shows how you can use the selection of the rating in the popup to update the rating on the page. I used a RadWindow instance as a popup, nevertheless you can replace it with a popup of your choosing, which will change only the implementation of the showing and closing of the popup.

I hope this helps. If you are still having difficulties after checking the attached sample, please modify it so that it matches your scenario and send it back. In case this is not possible, you could also describe the changes I need to make to the sample  in order to recreate your case more accurately.

Regards,
Slav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Rating
Asked by
Young
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or