0
Look it is possible to sort a table by date in javascript, symfony2 or jquery?
I have a table with various data and records and I would like to sort the records by date.
0
Look it is possible to sort a table by date in javascript, symfony2 or jquery?
I have a table with various data and records and I would like to sort the records by date.
1
Using symfony2 you can already bring the ordered data in the query.
There are several ways to do it, you can do the query directly in the Controller or create an Entityrepository
For example in the controller:
$em = $repository = $this->getDoctrine()->getRepository('SeuBundle:Post');
//voce pode filtrar por algum campo
$dados = $em->findBy(array('tipo'=>'AB'), array('data'=>'DESC')); //ou ASC
//ou você pode trazer todos os resultados somente ordenando
$dados = $em->findBy(array(), array('data'=>'DESC'));
Browser other questions tagged javascript jquery symfony-2
You are not signed in. Login or sign up in order to post.
Take a look if this helps you: http://tablesorter.com/docs/
– Luis Henrique
If you have already sent the data to the client, it should be sent already ordered or provide some form of sorting with Javascript or jQuery. If you didn’t send them, you need to sort with PHP or directly with SQL. Describe your problem better.
– Rodrigo Rigotti
The thing is, we imagine a table with various interventions on a machine, what I want is to sort these interventions by date, from today down.
– Catarina Silvestre
It is an equal table there is in the link below in the Demo that I intended, but instead of having to click in the fields to sort, the table is already sorted by date. http://tablesorter.com/docs/
– Catarina Silvestre
You can simply pull the data from Data, and send it to the already ordered client
– Danilo Oliveira
How can I do that?
– Catarina Silvestre
@Catarinasilvestre post as you are currently searching for this data, and we propose a change upon this.
– Rodrigo Rigotti