ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Reset to first page when sorting on other pages
Title:
B
I
{code}
?
Hi, I am using the grid with single field sorting. When I sort by a column on the first page of the results, the results are sorted and displayed correctly. However, when I am on a different page of the results, and I change the sort order, I expect to see the first page, with the results being sorted by the header field that I clicked on, But I am still on the page from which I initiated the sort. How can I force the grid to reset to first page, whenever the sort order is changed. Your demo's also exhibit the same behaviour. Thanks, Ajay
Save Changes
Cancel
ajaywebdev
asked at 03 Dec 2014
yes the demo shows this behaviour, because this is the expected behaviour
at 03 Dec 2014
Omu
Most of the apps that I've built and used that support sorting, take you to the first page when sort field changes. It is not practical to change sort criteria and stay on the same page. Do you have any recommendations on how to go back to first page when sort field changes.
at 03 Dec 2014
ajaywebdev
Answers
B
I
{code}
?
you can do this by adding this script on your page: $(function() { $('.awe-grid').on('aweload', function() { $(this).find('.awe-sortable').on('click', function () { $(this).closest('.awe-grid').data('o').oparams = { page: 1 }; }); }); });
Save Changes
Cancel
Omu
answered at 04 Dec 2014
Thank you. this is what I was looking for.
at 15 Dec 2014
ajaywebdev
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK