$filter_order_Dir;
}
As with the view, we retrieve the order column name and direction using the
application getUserStateFromRequest() method. Since this data is going to be
used to interact with the database, we perform some data sanity checks to ensure
that the data is safe to use with the database.
Finally, we build the ORDER BY clause and return it. When we deal with entities that
have an ordering field, we generally build more complex ORDER BY clauses. For
example, when we order by ascending name, we might want the ORDER BY clause to
be ORDER BY name, ordering.
Now that we have done this we can use the table headings to order itemized data.
This is a screenshot of such a table:
Notice that the current ordering is name ascending, as denoted by the small arrow to
the right of Name.
Filtering and Searching
In many respects, the process of filtering and searching itemized data is very similar
to ordering itemized data. We'll begin by talking a look at filtering.
This is a screenshot of the filtering and search form controls that appear at the top of
the Article Manager:
In this case, there are many filtering options: the section, category, author, and
published state.
Pages:
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321