phproad / phpr-framework

[PHPR Framework] PHPRoad system files
http://phproad.com
MIT License
12 stars 2 forks source link

DB Filter Flexbility #27

Open patrickheeney opened 11 years ago

patrickheeney commented 11 years ago

Right now you can only add filters for columns with relations. We should expand this to include all kinds of filters. The "switchers" should be removed in favor of a boolean type filter. We should add other types to search by integers (for example a filter to show products <$XXX) and searching on text fields. Also need to include the appropriate views:

screen shot 2013-09-23 at 20 54 09

screen shot 2013-09-23 at 11 19 53 pm

Maybe the Db_FilterBehavior can have a formRender to create complex type filters using $custom_columns. Something like:

class Shop_ProductFilter extends Db_DbFilter
{
    function define_columns()
    {
        $this->define_column('price')->renderAs(frm_text);
    }

    function define_form_fields()
    {
        $this->add_form_field('price', 'left')
    }
}