开发者

How to set the relative order of columns with a zfdatagrid?

开发者 https://www.devze.com 2023-01-27 02:15 出处:网络
To those of you who are familiar with zfdatagrid for the Zend framework: I got a rec开发者_StackOverflowordset by a JOIN query, say from tables s and t, now I want to set the order in which the colum

To those of you who are familiar with zfdatagrid for the Zend framework:

I got a rec开发者_StackOverflowordset by a JOIN query, say from tables s and t, now I want to set the order in which the columns appear in the deployed table.

For example,

5th column of table t to appear at the leftmost side,

then 3rd column of table s,

then 2nd column of table t,

then 4th column of table s.

How do I do this? Whatever I tried, it always shows first the columns of the left table of the JOIN, then the columns of the right table of the JOIN.

I only know how to tell it which columns to show, but not their order.


It may be late but may be useful for others

You can use:

$grid->updateColumn($field,array('position'=>$i))
0

精彩评论

暂无评论...
验证码 换一张
取 消