custom action template

A place for users and developers of the Xataface to discuss and receive support.

custom action template

Postby dynamic » Mon Jan 28, 2013 1:27 pm

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
dynamic
 
Posts: 3
Joined: Thu Jan 17, 2013 2:35 pm

Re: custom action template

Postby shannah » Tue Jan 29, 2013 9:57 am

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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot] and 2 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved