⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Per Row Callbacks?



Scott

Scott
  • profile picture
  • Member

Posted 17 July 2017 - 04:17 AM

I would like to hide whole rows based on criteria.

 

Something similar to...

if(row.contains(value))
    row.hide();

Is there an easy way to do this without diving into list.php?  Right now I'm using callback_column on every row with a function that calls back to handler to check for 'value' and return an empty string if it finds it.  It's ugly, shows empty rows in the table, and doesn't seem to work with relations correctly (it still displays them if I try to empty them).  

 

Thanks


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 17 July 2017 - 04:57 AM

Well - thats a piece of hack that you looking into. Rather - what i will recommend is restriction of records @the retrieval point itself. You can filter the data using $crud->where

That should help you achieve the same.

 

Happy GCing :)


Scott

Scott
  • profile picture
  • Member

Posted 23 July 2017 - 15:13 PM

Perfect, thanks!

if($permission != "all")
	{
		$permissions = explode(",", $permission);
		foreach($permissions as $i => $item)
		{
			$crud->or_where('gate', $item);
		}
		
	}