Colums in list tab are not well ordered with calculated fields, hereafter a little patch to solve the problem (may it should be helpful for somebody) :
fix are in Dataface/ResultList.php :
Add
- Code: Select all
foreach ($grafted_fieldnames as $field){
if ( $grafted_fields[$field]['visibility']['list'] != 'visible') continue;
$this->_columns[] = $field;
// AVT - new col
$this->avt_OrderColumns($tablename);
}
$this->_resultSet =& Dataface_QueryTool::loadResult($tablename, $db, $query);
And add the function
- Code: Select all
//------------------------------------------------------------------
function avt_OrderColumns() {
function sortOrder($a, $b) {
return($a['order']-$b['order']);
}
$fields =& $this->_table->fields();
$gfields =& $this->_table->graftedFields();
$list = array();
foreach ($this->_columns as $fid) {
$field['id'] = $fid;
if (isset($fields[$fid])) $field['order'] = $fields[$fid]['order'];
else $field['order'] = $gfields[$fid]['order'];
$list[] = $field;
}
usort($list, 'sortOrder');
$line = '';
unset($this->_columns);
foreach ($list as $field) {
$this->_columns[] = $field['id'];
}
}