Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Sortable GridField unexpected token

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 317 Views
  • Bambii7
    Avatar
    Community Member
    254 Posts

    Sortable GridField unexpected token Link to this post

    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 );
          }
    ...

    317 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.