Page 1 of 1

Embedded SQL queries customization

PostPosted: Tue Nov 04, 2008 4:10 am
by Karonthe
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:

PostPosted: Tue Nov 04, 2008 12:47 pm
by shannah
Which things would you like to parametrize?

PostPosted: Wed Nov 05, 2008 1:40 am
by Karonthe
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:

PostPosted: Wed Nov 05, 2008 8:14 am
by shannah
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