Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

Minor problem found on CRUD sorting (but solved)

posted by aris 9 years ago

I'm using fCRUD for sorting table rows. All sortable columns were running fine, but one. This is a column reflecting a boolean value for a group status (active / not active), but I have other boolean values in the table and they were sorting fine. Moreover, the direction of the sorting was changing each time, but no real sort seemed being done in that column at all.

Finally, it arises that the problem was related to column names. Actually, the column I was sorting on is the 'active' column in the groups table, but I also have an 'active' column in user_groups table. As far as I need to use a join of both tables for that page (a UserGroups recordset which calls precreateGroups()), it seems now clear that the sorting was being applied to that column in user_groups, not to the required one (in groups).

The solution its easy: just specifying the full table.column in the fCRUD call, did the trick:

#!text/html
<td class="<?php echo fCRUD::getColumnClass('groups.active') ?>">

Although it's logical after all, maybe it's worth pointing that issue in the fCRUD documentation page...

Regards,

A.

Thanks for posting about this! I've added some documentation to the fCRUD page that should help future users.

posted by wbond 9 years ago