Reputation: 1
I have 4 columns in a datagrid. The manuals give examples on how to sort on a column derived from the database using the array('OrderByClause' => QQ::OrderBy(QQN::Pubs()->Name)
however, I want to sort on a calculated results $_FORM->getDistance($_ITEM)
What I have so far is this:
$this->dtgPersons->AddColumn(new QDataGridColumn('Row Number', 'CurrentRowIndex + 1) ?>'));
$this->dtgPersons->AddColumn(new QDataGridColumn('Pub Name', 'Name ?>', 'Width=200', //)); array('OrderByClause' => QQ::OrderBy(QQN::Pubs()->Name), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Pubs()->Name, false))));
$this->dtgPersons->AddColumn(new QDataGridColumn('Street', 'Address1 ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Pubs()->Address1), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Pubs()->Address1, false))));
$this->dtgPersons->AddColumn(new QDataGridColumn('Distance from Location', 'getDistance($_ITEM) ?>', 'Width=300'));
This following line works on columns that have a sort on them
$this->dtgPersons->SortColumnIndex = 2;
Upvotes: 0
Views: 133
Reputation: 340
I am unsure about this. Try asking at the github page - http://github.com/qcubed/framework.
Upvotes: 0