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.

All other Modules /

Discuss all other Modules here.

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

Sortable GridField unexpected token


Go to End


886 Views

Avatar
Bambii7

Community Member, 254 Posts

15 October 2013 at 3:34pm

HI All.
I'm running SS 3.0.8, and trying to make use of UndefinedOffset/SortableGridField

And getting "Unexpected token u GridField.js:83" when checking "Allow Drag and Drop". Anyone had similar issues or know of a fix/alternative?

My cms fields function looks like

...
if( $this->exists() ) {
$config = GridFieldConfig_RelationEditor::create(10);
$config->addComponent(new GridFieldBulkEditingTools());
$config->addComponent(new GridFieldBulkImageUpload());
$config->addComponent(new GridFieldSortableRows('SortOrder'));
$gridfield = new GridField( 'Products', 'Products', $this->Products() );
$gridfield->setConfig( $config );

// set display field
$columns = $gridfield->getConfig()->getComponentByType('GridFieldDataColumns');
$columns->setDisplayFields(array(
'Thumbnail' => 'Image',
'Label' => 'Label',
'UUID' => 'UUID'
));

$fields->replaceField( 'Products', $gridfield );
}
...