Transmit data from a data grid to a action button

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

Transmit data from a data grid to a action button

Postby Jean » Thu Oct 16, 2008 6:15 am

Hi Steve,

I have created a grid from an action. This action get records from the database according to various sql queries.
In the page of the results grid I have a action button to export a CSV of this result.
The data exported now into CSV format is not correct so I need to send some data to my action. I need to put some dynamic data into the url of the button action to export the right result. I need to tell my CSV action which query I used.

I thought I could include this data dynamically into the url of his CSV action.

Could you tell me how to do this ? Do I have to create a Javascript button or can I do something more simple ?

Kind regards

Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Postby shannah » Fri Oct 17, 2008 7:51 am

Hi Jean,

It is certainly possible to add dynamic data to any action. It's hard for me to comment on the "how" without a little more detail, though. Are you using the Xataface built-in CSV action in some way, or are you doing the export in a custom way?

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Jean » Mon Oct 20, 2008 1:16 am

Hi Steve,
In fact I have created a custom action that is actually the
xataface-1.0-beta-3/actions/export_csv.php file content.
Thank you for your help
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Postby Jean » Tue Oct 28, 2008 6:17 am

Hi Steve,

Eventually, I found a solution for my button :idea: . I added a field in my array that I did not displayed in my grid. For that I modified my template Dataface_RecordGrid.html.

Then I added a button in my template with the information in its URL telling which query I used to get the data to display.

I hope I am clear :?
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 23 guests

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