public function setup_index(&$grid) { $this->sidebars->add('Filters', Petro::render_filters(array('first_name' => array('type' => 'string'), 'last_name' => array('type' => 'string'), 'status' => array('type' => 'select', 'collection' => $this->model)))); $grid->add_scope('all', 'All'); $grid->add_scope('working', 'Working', array('status', '=', 1)); $grid->add_scope('suspend', 'Suspended', array('status', '=', 2)); }
public function action_index() { $grid = new Petro_Grid('Model_User', static::_columns()); // $grid = new Petro_Grid('Model_User', array('id', 'username', 'email')); // $data['index_content'] = $grid->render(array('username', 'id', 'email')); $this->sidebars->add('Filters', Petro::render_filters(array('username' => array('type' => 'string'), 'email' => array('type' => 'string')))); $this->action_items = array(array('title' => 'Add New User', 'link' => Petro::get_routes('new'))); // $this->template->page_title = "Users"; $this->template->set('content', $grid->render(), false); }
public function setup_index(&$grid) { $this->sidebars->add('Filters', Petro::render_filters(array('code' => array('label' => 'Code', 'type' => 'string'), 'name' => array('type' => 'string'), 'status' => array('type' => 'checkbox', 'collection' => Petro_Lookup::get('client.status'))))); }