Page 1 of 1

custom action template

PostPosted: Mon Jan 28, 2013 1:27 pm
by dynamic
Hello,

I define a new action "reports" that use a query and show data in to grid in "list" tab:
import('Dataface/SkinTool.php');
import('Dataface/RecordGrid.php');
$grid = new Dataface_RecordGrid($data);

df_display(array('body'=>$grid->toHtml()), 'Dataface_Main_Template.html');

But this grid don't have the same functionality like the default "list" tab format: sort, filter, record-> cell link etc.
How to show my action query in the default "list" format. Replace Dataface_RecordGrid() class with what ? Can you show me an example ?

Thanks ,

Dan

Re: custom action template

PostPosted: Tue Jan 29, 2013 9:57 am
by shannah
The RecordGrid component, while similar to the list view, is not the same - and List view actually doesn't use the RecordGrid at all. Sorting in the list view actually refreshes the page with different sort parameters - and this just won't work with a component that you embed in your own action, without some cooperation of the action itself.

If you only need to sort the rows that are visible in your grid, you might want to use Javascript. There are lots of jQuery plugins for table sorting, and rolling your own isn't that hard.
e.g.
http://tablesorter.com/docs/

-Steve