Page 1 of 1

Transmit data from a data grid to a action button

PostPosted: Thu Oct 16, 2008 6:15 am
by Jean
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

PostPosted: Fri Oct 17, 2008 7:51 am
by shannah
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

PostPosted: Mon Oct 20, 2008 1:16 am
by Jean
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

PostPosted: Tue Oct 28, 2008 6:17 am
by Jean
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