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

How to run JavaScript function after page change?

1 Answer 715 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 25 Jun 2012, 03:58 PM
Hi,
I change the content in one of my columns with JavaScript (I need to fetch data from SharePoint with their Client Object Model). This works as expected the first time I load the pages in my grid. But not when I go to a page i've already loaded.

For example: Say that I have two pages in my grid. When I load the aspx, the content in the column is updated properly with data from SharePoint. When i press "Next Page" the grid changes page, my function gets called and the column is updated with correct data.
If I press "Prev Page" my function is never called and hence the column is never updated.

Is there a way to solve this?

I've tried a lot of different approaches to get the function to execute: $(document).ready, adding script from the PageIndexChange event, script tag in the ItemTemplate for the column, attaching client side click event to the "pages" buttons etc.


Regards,
Martin

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 28 Jun 2012, 10:41 AM
Hi,

 You can try some of the client-side events of the grid such as GridCreated or OnCommand

Greetings,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Martin
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or