21489 Posts in 5783 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 489 Views |
-
GridFieldConfig_RelationEditor select by checkbox?

14 August 2012 at 3:51pm Last edited: 14 August 2012 3:51pm
I've created a number of Gridfields with GridFieldConfig_RelationEditor for some many_many relationships.
The way this works is not ideal as the user must know what has already been added to be able to search for it.
Is there a way to achieve similar to what we used be able to do with the Dataobjectmanager. ie displaying every item and allow them to select the ones they want with a checkbox?
Activity.php
<?php
class Activity extends DataObject{
public static $db = array(
'Title' => 'Varchar(255)',
'Summary' => 'Text'
);
static $belongs_many_many = array(
'TourPages' => 'TourPage'
);
public static $summary_fields = array(
'Title' => 'Title'
);
public function getCMSFields_forPopup() {
return new FieldList(
new TextField('Title', 'Title'),
new TextareaField('Summary', 'Brief Summary')
);
}
}TourPage.php
....
static $many_many = array(
'Activities' => 'Activity'
);
.....$gridField = new GridField("Activities", "Activities", $this->Activities(), new GridFieldConfig_RelationEditor);
$fields->addFieldToTab("Root.Activities", $gridField); -
Re: GridFieldConfig_RelationEditor select by checkbox?

15 August 2012 at 6:44am Last edited: 15 August 2012 7:00am
+1 to the question.
I want to solve this problem as well.
-
Re: GridFieldConfig_RelationEditor select by checkbox?

15 August 2012 at 10:55am Last edited: 15 August 2012 11:36am
This is just one of a few issues I am having with GridFields. The documentation is hugely lacking at the moment and it seems quite buggy.
When you add a new item or edit an existing one, why can you not return directly to the GridField? It is an annoyance for the user to have to come all the way out and go back in each time they want to add or edit something?
Randomly, when a new item is added, or an existing one edited and you click in the crumbtrail to get back to the page, 2 throbbers appear followed by a blank grey screen, requiring a refresh before any further action can be taken.
We are also experiencing random "Request-URI too large" errors when searching for items in the RelationEditor.
It's a pretty horrible experience handing this over to clients in this state.
I miss DataObjectManager.
-
Re: GridFieldConfig_RelationEditor select by checkbox?

4 September 2012 at 4:14pm
A good question, I been trying to get the answer for it too ... I will have a look at blogs & IRC to see if anyone can help .
IF you have the answer already, pleas please post here
Thanks -
Re: GridFieldConfig_RelationEditor select by checkbox?

29 January 2013 at 5:02am
Have a look at https://github.com/simonwelsh/silverstripe-GridFieldRelationHandler this is what you want
-
Re: GridFieldConfig_RelationEditor select by checkbox?

8 April 2013 at 3:18am
Hi, anyone found a solution how to fix "Request-URI Too Large" issue?
| 489 Views | ||
|
Page:
1
|
Go to Top |



