Re: Can I disable sorting in Structures::Datagrid?

From: Date: Sat, 22 Apr 2006 21:14:42 +0000
Subject: Re: Can I disable sorting in Structures::Datagrid?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23808@lists.php.net to get a copy of this message
dondo wrote:
Awesome, I'll give it a try. Another feature that would be nice (and it might already be possible) is the ability to easily override the default sort direction for each column. I'll do this in the custom header of course, but it might be a feature to consider.
There is a new method : Structures_DataGrid::setDefaultSort() It allows to specify how the DataGrid must be sorted when it is first seen by the user. But it seems like you want to specify the default sort for _each_ column, like ASC for column1, DESC for column2, etc... I believe we'll never provide options for such a specific need. The danger always is that the package may get bloated with options, specific methods, etc... But we have tried to make customizing or writing rendering driver from scratch as easy as possible, because we realized that's the only way to answer the wide variety of needs that we observe. I'm currently writing a HOWTO about this, that will be included in the end-user manual.
While I'm at it, I'll suggest another feature.. the ability to specify a "then by" column to sort by. I.e, the equivalent of ORDER BY columnA, columnB in SQL.
That's what we call the "multiSort" feature.
I haven't dug into the DataGrid code enough to see how everything works, so perhaps I have just missed a currently existing way to do this or maybe it would be too difficult or outside the scope of the project.
We are in the process of implementing multiSort. The renderer and datasource core layers support it, as well as the DB_DataObject datasource driver. However, there is no rendering drivers that support multiSort, and the core controller (Structures_DataGrid class) is not ready for it. It's not very hard, but not easy either. We're trying to do things as clean as possible and that takes time...
Anyway it's a great library as it is and I really like using it.. it's lightning fast for one thing.
Thanks ! -- og

« previous php.pear.general (#23808) next »