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

sort

posted by mungiu 9 years ago
// Set the users to be sortable by name or email, defaulting to name
			
$sort = fCRUD::getSortColumn(array_keys($column_info));

// Set the sorting to default to ascending
$dir  = fCRUD::getSortDirection('asc');
 
// Redirect the user if one of the values was loaded from the session
//fCRUD::redirectWithLoadedValues();

i'm doing something wrong? fCRUD::printSortableColumn($column); print link but dir value in link it's not the opposite by value in actual link. i know in a earlier version works fine.

Maybe it's something with session because when i use this: $sort = fCRUD::getSortColumn(array_keys($column_info)); and $column_info is change remain with old value;

posted by mungiu 9 years ago

There haven't been any changes to fCRUD in the past nine months, so I am leaning towards some issue in your application.

That said, I don't exactly know what is going wrong since you didn't include any example of the incorrect output.

posted by wbond 9 years ago

sorry. i discover what was wrong, some code after another.

posted by mungiu 9 years ago

till remain the second problem. this is the code:

// Set the users to be sortable by name or email, defaulting to name
			fCore::expose(array_keys($column_info));
$sort = fCRUD::getSortColumn(array_keys($column_info));
			fCore::expose($sort);

and print:

Array
(
    [0] => email
)

categorie
Uncaught fProgrammerException
-----------------------------
{doc_root}\\cd\\admin\\index1.php(7): FormGenerator->__construct(Object(fDatabase))
{doc_root}\\cd\\inc\\classes\\FormGenerator.php(238): Newsletter::getAll('categorie', 'desc', NULL, 2)
{doc_root}\\cd\\inc\\classes\\FormGenerator.php(68) : eval()'d code(38): fRecordSet::build('Newsletter', Array, Array, 2, NULL)
{doc_root}\\cd\\inc\\flourish\\fRecordSet.php(225): fORMDatabase::addOrderByClause(Object(fDatabase), Object(fSchema), Array, 'newsletter', Array)
{doc_root}\\cd\\inc\\flourish\\fORMDatabase.php(403): fSchema->getColumnInfo('newsletter', 'categorie', 'type')
{doc_root}\\cd\\inc\\flourish\\fSchema.php(2207)
The column specified, categorie, does not exist in the table newsletter
posted by mungiu 9 years ago