Artur Bekerov2014-01-25 18:37:15
Artur Bekerov, 2014-01-25 18:37:15

Angular table sort?

the backend returns a list, angular displays a table
city name
I want to make a structure when adding an element like:
Federal District
-Region --City
can I display these records in the backend and then filter by region, county or city?
output like this?
name city region district
After all, in the first case, even if there were 1000 rows, it works quickly, and with an increase in the property and nesting of categories, the size of the received data will grow.
how to do better?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
itspers, 2014-01-26

I wrote a self-made datagrid directive for myself with pagination, sorting and inputs under the search header. I give it one large object with data, settings and column structure. With any mouse click, it calls the update method, which sends a request {page 7, number of records 20, sorting: title, order: asc, filterTitle: 'abc', filterSurname: 'asd'}, the backend generates a request and issues a bunch of data in json, the resulting array is automatically picked up by the directive and the grid is redrawn.
In general, you can implement the same approach, just add a link between the filters in the columns so that you select the Region - it updates the list of cities ..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question