A
A
Arthur2018-08-07 16:29:15
Yii
Arthur, 2018-08-07 16:29:15

How to sort gridview yii2 without reload?

A table is loaded on the page using GridView::widget
Now, when you click on the table headers, a new page with sorted data is loaded. (table without pagination)
Is it possible to specify in the widget settings what needs to be sorted on the client, without requests, current data?
Or do I need to add some kind of js plugin on top of what is already there and turn off filtering on yii for everything?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-08-07
@cloudz

Is it possible to specify in the widget settings what needs to be sorted on the client, without requests, the current data?

When you click, you sort by all the data, and not by those on the page. So if you want to have sorting on the client:
1. You have to give all the data
2. Use some kind of js table plugin
Or, as an option, wrap everything in pjax and the user will have no idea that it is not sorted on the client.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question