Embedded SQL queries customization
Archived from the Web Auction Discussion forum.
Karonthe — Tue Nov 04, 2008 4:10 am
Hi,
I’m trying to customize the Watch List and noticed that the manager module (actions/watch_list.php) contains a hardcoded SQL query with a couple of joins.
That leads to hardcode the column headers that appear on the bids grid, thus not allowing to customize it via fields.ini.
Is there any (easy) way to “extract” the query logics and parametrize its appearance?
Thank you
shannah — Tue Nov 04, 2008 12:47 pm
Which things would you like to parametrize?
Karonthe — Wed Nov 05, 2008 1:40 am
Well, maybe is not a matter of Webauction but Xataface, don’t know if it’s possible for on-the-fly queries.
What I’d like is to define an external description file fields.ini, thus allowing to customize/parametrize easily the grid headers, labels, visibility and so.
The problem is that if I try to change the “field xxxx as yyyy” clauses in this select statement (so that the columne headers show as I’d like) , the link construction below does not work properly since these names are needed by xataface to identify the table columns.
Thanks for your patience
shannah — Wed Nov 05, 2008 8:14 am
The easiest way to add column labels is by adding them as the third parameter to the RecordGrid constructor.
e.g. the following line
- Code: Select all
$grid = new Dataface_RecordGrid($data);
Can be changed to
- Code: Select all
$grid = new Dataface_RecordGrid($data, null, array('Heading 1', 'Heading 2', etc....));
-Steve