How to alternate row actions in admin

edited August 2016 in Bug Reports
How to alternate row actions in admin like EDIT | DELETE , I want to add VIEW and custom actions
Thank you

Comments

  • edited 1:21PM
    View will appear if you specify a "preview_path" value in the module's config. To set a different row items, you can specify the module's "table_actions" which is an array of keys being a URL (which can use placeholders {id}) and values being the label. You can also specify it as the following:
    ... 'table_actions' => array('url' => fuel_url('my_module/my_method'), 'attrs' => 'class="my_class"'),...

    Or a callback function using the "func" key:
    ... 'table_actions' => array('func' => create_function('$fields', ....)),...

    The fuel/modules/fuel/controllers/module::items method calls that.
  • edited 1:21PM
    Good Thank you ,
    I have another question , in my advanced module custom method , I use data table to show data which contain enum field "approved" yes/no , can I make use of toggling functionality ? or make my own ajax function
  • edited 1:21PM
    I suggest open comments on user guide , like php manual , to allow users write examples and more explanation , what do you think ?
  • edited 1:21PM
    You can specify in your model public $boolean_fields = array('my_field_name'); and it can be either an enum with 2 values or a boolean field (which is really a tinyint with a 0 or 1 value). Fields "published" and "active" are automatically treated this way.

    Regarding the open comments, I understand the need to do that but at this time it's an additional thing that would need to be managed.
Sign In or Register to comment.