28 Jan 2010 @ 3:55 PM 

This post deals with adding filters to a grid so that you can filter the result set. The reason for this is that you might have large grids (eg 100 000 items) and you dont necessarily want to search through all that info to get to the row you want to view/edit

$filter = new datafilter_library();
$filter->label = 'User Filter';
$filter->db->select('user.*, customer.company_name, customer.trading_entity_type_id');
$filter->db->from('user');
$filter->db->join('customer', 'user.customer_id = customer.customer_id');
$filter->field('dropdown', 'trading_entity_type_id', 'Trading Entity Type')
  ->options(array('1'=>'Associate',
                        '2'=>'Wholesaler',
                        '3'=>'Retailer'));
$filter->field('input','company_name','Company Name');//->attributes(array('style' => 'width:170px'));
$filter->field('input','user_name','User Name');
$filter->field('input','user_idnumber','ID Number');
$filter->field('input','email','email');
$filter->buttons('reset','search');
$filter->build();
 
$grid = new datagrid_library();
$grid->label = $this->title;
$grid->source($filter);
$grid->column('company_name','company');

Notice that the grid is no longer linked to a query, but is linked to the filter.

Filtered grid sample

Posted By: Zayin
Last Edit: 28 Jan 2010 @ 03:55 PM

EmailPermalink
Tags
Tags: ,
Categories: php, rapyd


 

Responses to this post » (2 Total)

 
  1. U. Micha says:

    Hi, today I downloaded rapyd 0.7 and made it run on C:/xampp/htdocs/rapyd using the .htaccess from CodeIgniter’s user_guide. With this skipping over “index.php” I can arrive “http://localhost/rapyd/demo” but as a result of some analysis, rapyd does not get the “rapyd/rapyd/assets/raypd.css”, nor does it get the “rapyd/modules/demo/assets/*.png” images. – Do you have any ideas, why this could be? – Yours, Micha

  2. Zayin says:

    you’ll have to check your paths and config files. I had quite a hassle getting rapyd running with CI. In fact, I’ve done a lot of hacking in rapyd itself to make it play nicely with CI

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.


 Last 50 Posts
 Back
Change Theme...
  • Users » 1
  • Posts/Pages » 38
  • Comments » 61
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Links



    No Child Pages.

Portfolio



    No Child Pages.