Giter Site home page Giter Site logo

mrself / symfony-tree-form-type Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 684 KB

Symfony 4 tree from type based on JsTree plugin.

License: MIT License

JavaScript 2.69% HTML 0.53% TypeScript 53.17% SCSS 0.05% PHP 42.37% Twig 1.20%
symfony symfony-bundle symfony4 tree-form

symfony-tree-form-type's People

Contributors

mrself avatar

Watchers

 avatar

Forkers

nin2h

symfony-tree-form-type's Issues

Add support for the node dependencies

It may be useful so some other nodes (dependencies) are selected on the main node select.

For example, there are such nodes:

  • Primary Node
  • Dependency 1
  • Dependency 2

And when a user clicks Primary Node, all other dependencies are auto-selected.

A new option dependencies will be added to the form type, where keys are node ids and values are the ids of node dependencies.

Make possible to pass "associations" options

Currently, associations can be set only for a specific node #1 and not in batch. However, it may be quite useful to use a separate option for associations. The necessary option object will have a node id as a key and associations array as a value:

{
  associations: {
    'conditionNodeId': ['associationNodeId1', 'associationNodeId2']
  }
  // ... rest options
}

Make possible to add a button to a node text which would select node association on click

Suppose, there is a tree node which should select select other nodes on click. But not always, a web user will choose if it is necessary so those associations will be selected. In other words, provide a button for a user which will trigger select for other nodes.

The implementation will look like this:

Such button is inserted to the node html at the moment of generating the data for jstree. For example:

$tree = [
  // ... required properties
  'text => "My node <span data-association-trigger>Select associations</span>"
]

The button in this case is represented with the span tag. Actually, it does not matter. We can not use a tag because jstree already places the text in a tag. In any case, a "click" event will be bound to the trigger element directly.

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.