Pregunta

Happy New Years Eve!

I would like to be able to set the default for value some columns to descending. So, the first time the user clicks on that column, it sorts descending by nature.

I have no problem setting the default sort field and order of my grid. But that is all the info I am finding.

$grid->setGridOptions(array(

"caption"=>"Player Statistics",
"rowNum"=>200,
"rowList"=>array(50,200,1000),
"sortname"=>"percentOwned",
"sortorder" => 'desc',
"width" => 1000,
"height" => 400,
"hoverrows" => true,
"viewrecords" => false

));

How do I set the default sort to descending on a per column basis? Is it possible?

Thanks!

¿Fue útil?

Solución

Although not in the documentation, 'firstsortorder' => 'desc' does the trick.

$grid->setGridOptions(array(
'firstsortorder' => 'desc'
"caption"=>"Player Statistics",
"rowNum"=>200,
"rowList"=>array(50,200,1000),
"sortname"=>"percentOwned",
"sortorder" => 'desc',
"width" => 1000,
"height" => 400,
"hoverrows" => true,
"viewrecords" => false
));
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top