Filter on category in list view and export filtered data

edited April 2014 in Modules
After years of trying to build my own CMS solutions on top of Codeigniter I am diving into Fuel now and really loving it! I am wondering if the following is possible. I have an advanced module with -among others - e-mail addresses and categories. I would like to filter the admin list view on category and use the export button just to export that category. Would be great if anyone could point me in the right direction. Thanks!

Comments

  • edited 5:23AM
    To filter the list view, there is a "filters" and "filter_join" model parameters you can set. The filter_join can be used to specify whether to use "and" or "or" in you filtering:
    public $filters = array('category');
    Similarly, to add a filtering control to your module, you can add a "filters" parameter to your module which specifies a form builder array of controls for the filtering:
    'filters' => array('category' => array('type' => 'select', 'options' => array('option1' => 'option1', 'option2' => 'options2')))
    Alternatively, you can set a "filters" method in your model that returns the Form_builder array as well.

    For the export button, you can overwrite the "export_data" on your module's model.
  • edited 5:23AM
    That is really helpful, thanks!
Sign In or Register to comment.