Embedded SQL queries customization

A place to discuss and receive support for the Web Auction application.

Embedded SQL queries customization

Postby 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 :wink:
Karonthe
 
Posts: 9
Joined: Tue Oct 21, 2008 6:03 am

Postby shannah » Tue Nov 04, 2008 12:47 pm

Which things would you like to parametrize?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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 :wink:
Karonthe
 
Posts: 9
Joined: Tue Oct 21, 2008 6:03 am

Postby 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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 30 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved