GithubHelp home page GithubHelp logo

datafield's Introduction

Data Field

A quick entry field allowing users to enter a lot of data

Requirements

  • SilverStripe ^4.0

Installation

composer require adrhumphreys/datafield dev-master

If you have an object with a relation has_many/many_many then you can use the field.

Say your relation looks like the following:

private static $has_many = [
    'Animals' => Animal::class,
];

Then you can make a basic field: DataField::create('Animals'); If you want to change the relation/class name being used then: DataField::create('Animals', 'Animals', Animal::class,'Animals');

You'll then need to configure what fields will be editable on the class like so:

class Animal extends DataObject
{
    private static $db = [
        'Name' => 'Varchar',
        'Type' => 'Varchar',
        'Color' => 'Varchar',
    ];

    private static $editable_fields = [
        'Name',
        'Type',
        'Color',
    ];
}

datafield's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.