Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Form in custom GridFieldComponent


Go to End


5 Posts   1164 Views

Avatar
zz

Community Member, 16 Posts

27 July 2015 at 11:19pm

Hello,

I am trying to create a Form as a GridFieldComponent or access to some rendered Field through GridField_FormAction, e.g. I will have some TextField + Button / Radios + Button and after click I could get to their values.
Any ideas?

Thanks.

Avatar
Pyromanik

Community Member, 419 Posts

28 July 2015 at 9:45pm

Edited: 28/07/2015 9:45pm

Can you explain better? Because you just described GridFieldDetailForm (the default for eg. GridFieldConfig_RelationEditor). Or is this what you want?

Avatar
zz

Community Member, 16 Posts

30 July 2015 at 1:20am

I am not sure how to use GridFieldDetailForm in this case.
I want to create not just button like you have Print or CSV export (GridField_FormAction). , but something more complex, i.e. some kind of Form which will be after / before list of items, not within rows, and I can add it as a Component.

I am not much familiar with controllers and I do not know what to put as a first parameter as Controller into Form constructor when creating Component wia getHTMLFragments($gridField). I tried to use GridField_FormAction instead of FormAction, it worked but I get an ERROR [Warning].

Avatar
Pyromanik

Community Member, 419 Posts

30 July 2015 at 3:53am

I'm afraid you're going to have to draw a diagram of desired outcome (indicating usability with annotations perhaps) beacuse I can't understand what exactly it is you're asking sorry.

Avatar
zz

Community Member, 16 Posts

31 July 2015 at 12:52am

Thank you for being patient :)

For example this form:

I just want to be able to access values of Fields when I click 'Do some Action'.