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

Save Grid Settings

3 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 30 Sep 2008, 08:54 AM
Hi,
I can succesfully save the grid layout to a cookie (will change to database) by using GridSettingsPersister.
However, i am having to save the layout by clicking a button.
Is there any way i can automatically save the layout without user intervention ?
(Preferably when the user leaves the page)


Many Thanks
Mark

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 02 Oct 2008, 12:32 PM
Hi Mark,

Basically, you can attach to the onunload client side handler and make an AjaxRequest to the server. This is one option to pursue, which would work in most scenarios.
Alternatively, you can use only server side functionalities (grouping/reorder), and save the grid state on each hit to the server. This way, when the user leaves the page, the state would be persisted. This can be coupled with Ajax, to simulate client side performance.
I hope these suggestions help.

Kind regards,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mark
Top achievements
Rank 1
answered on 06 Oct 2008, 03:42 PM
Hi,
I'm trying to attach to the onunload client-side handler, but its not firing the ajaxmanager request. I have added breakpoint to the RadAjaxManager1_AjaxRequest but its not breaking.
I have added an alert to the script and this IS working ?

Any ideas please ?
Thanks
Mark

 

<script type="text/javascript">

 

 

function OnWindowClose()

 

{

 

 

var ajaxManager = window["<%= radAjaxManager1.ClientID %>"];

 

ajaxManager.AjaxRequest(

"1");

 

}

 

</script> 

 

<

telerik:radajaxmanager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">

 

0
Yavor
Telerik team
answered on 09 Oct 2008, 06:42 AM
Hello Mark,

The onunload may be too late to call the handler. One possible alternative would be the onbeforeunload client side event.
I hope this suggestion helps.

Regards,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Mark
Top achievements
Rank 1
Share this question
or