PHP code example of webbuilders-group / silverstripe-limitedrelationsgridfield

1. Go to this page and download the library: Download webbuilders-group/silverstripe-limitedrelationsgridfield library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webbuilders-group / silverstripe-limitedrelationsgridfield example snippets


//Create a GridField instance with a page length of 10 and a item cound limit of 20
new GridField('MyGridField', 'My GridField', $this->Relationship(), LRGridFieldConfig_RelationEditor::create(10, 20));

//Create a GridField instance with a page length of 10 and a item cound limit of 20
new GridField('MyGridField', 'My GridField', $this->Relationship(), LRGridFieldConfig_RecordEditor::create(10, 20));

$myLimitedAutoCompleter->setItemLimit(3); //Change the item limit to 3

$myLimitedDetailForm->setItemLimit(3); //Change the item limit to 3