Skip to content

Sortable Column for those non-DataColumn? #1576

Closed
@qiansen1386

Description

@qiansen1386

In Yii1 if the column is not specified in DataProvider, there will not be any filter and we could not sort the table based on this column as well.
example. we have a column called Subtotal in Quotation_Item gridview.
it may looks like this

array(
            'header'=>'Subtotal',
            'value'=>'$data->getSubtotal()',
            'footer'=>'Total: '.$model->total,
        ), 

But how about we add some variable like compare and filter
E.g.

array(
            'header'=>'Subtotal',
            'filter'=>'number',
            'compare' => 'number'
            'value'=>'$data->getSubtotal()',
            'footer'=>'Total: '.$model->total,
        ), 

I post it here, so that i think that may be a sweet improvement in Yii2. Feel free to correct me, if i said anything wrong. Or we can implement a similar outcome by make some modification in Model instead of View?

I am apologized for my poor English.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions