Yii 1.1: sql-table-view

SqlTableView is a widget based on AutoCountGridView that displays the rows of a table efficiently.
3 followers

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',
));

Resources

Total 3 comments

#5083 report it
Adriano Silva at 2011/09/13 01:27pm
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

#5073 report it
prekageo at 2011/09/13 04:33am
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.

#5015 report it
Adriano Silva at 2011/09/06 04:17pm
doubt

Where these functions is used in the model or controller? You can use a more specific example. Where to use each class?

Leave a comment

Please to leave your comment.

Create extension