SqlTableView is a widget based on AutoCountGridView that displays the rows of a table efficiently.
Requirements ¶
auto count sql data provider extension
auto count grid view extension
Usage ¶
function id_formatter($id)
{
return '<div style="text-align:center;font-weight:bold">'.$id.'</div>';
}
$this->widget('application.extensions.SqlTableView', array(
'table'=>'tbl_user',
'criteria'=>array(
'condition'=>'username like "%"',
),
'formatters'=>array(
'id'=>'id_formatter',
),
'filter_get_variable'=>'grid',
'count_get_variable'=>'c',
));
doubt
Where these functions is used in the model or controller?
You can use a more specific example. Where to use each class?
answer to doubt
This extension is actually a widget so you have to add the sample code in your view. Do not forget that you must install this extension and its requirements in your extensions directory.
Help!
friend,
Sure, after you have installed this extension and others in need. How do I play one on the same command, for example:
SELECT data, v.ve_placa, v.ve_descricao, tipocombustivel, SUM(totallitros) AS TotalLitros, SUM(valortotal) AS TotalGeral, AVG(consumokml) as Média_Consumo, AVG(custokm) as Custo_Medio
FROM abastecimento a, veiculo v
WHERE v.ve_id = a.veiculo AND v.ve_tipo <> 'ALUGADO' AND consumokml != 0 AND custokm != 0
AND a.data BETWEEN '01/05/2011' AND '30/08/2011'
GROUP BY v.ve_placa
ORDER BY a.data ASC
I wish that she would always return a result of this query, it would help me a lot. You can help me.
Thanks in advance.
Adriano Silva
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.