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

[Solved] Sort not resetting page index (Custom Ajax Binding)

3 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David A.
Top achievements
Rank 1
David A. asked on 22 Oct 2011, 06:31 AM
Hi,

I am using Custom Ajax Binding per the live demo and everything works great but when I am at a page other than the first and sort, I would expect the page index to be set back to the first page.  Instead, it stays at the current page and even the demo does this.  Is this by design?

Thank you.
David

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 24 Oct 2011, 08:11 AM
Hello David,

Yes this is by design. Sorting does not reduce the count of the data shown in the grid, thus there is no need to reset page index.

You can check any other binding type of the grid and see that the behavior will be the same.

Greetings,
Nikolay Rusev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
David A.
Top achievements
Rank 1
answered on 24 Oct 2011, 04:44 PM
Would it be possible to inject "page=1" into each header link to be able to accomplish this?
Thank you.
David
0
Accepted
Nikolay Rusev
Telerik team
answered on 25 Oct 2011, 08:39 AM
Hello David,

Generally you can handle client OnLoad event of the grid component and execute the following script:
<script>
    function grid_load() {
        $(".t-header > a.t-link", this).each(function() {
            var link = $(this),
                href = link.attr("href").replace(/(\?(.*)?-page=)[0-9]*/ig, "$11");
            link.attr("href", href);
        });
    }
</script>


Best wishes,
Nikolay Rusev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
David A.
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
David A.
Top achievements
Rank 1
Share this question
or