Giter Site home page Giter Site logo

oc-relation-dynamic-dropdown-formwidget's People

Contributors

euknyaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

oc-relation-dynamic-dropdown-formwidget's Issues

Change language..

Hi @euknyaz , thanks for your work... very useful plugin.

I would like to change language in search box ('enter 1 or more characters')..

Where do i act ? Thanks ! Luca

Multi-select option for many-to-many relations

Implement multi-select option for many-to-many relations (currently we are limited to one-to-many and one-to-one relations only).

fields.yaml

 user:
        label: User
        comment: 'dynamic search and autocomplete with lazy loading'
        span: left
        type: relation-dynamic-dropdown
        select: CONCAT(first_name, ' ', last_name, ' - ', email)
        limit: 10
        attributes: { multiple: 'multiple' } # reserved for many-to-many relations

Multi-select demo

Demo

Not working

Hi, i've embed your plugin in my plugin but it doesnt work for me:

 customers:
        label: User
        span: storm
        cssClass: col-md-4
        type: relation-dynamic-dropdown
        select: name
        nameFrom: mail

in my model:

 public $hasOne = [
        'currency' => ['\Prestasafe\Erp\Models\Currency','key' => 'id','otherKey' => 'id_currency'],
        'customers' => ['\Prestasafe\Erp\Models\Customer', 'key' => 'id','otherKey' => 'id_customer'],
    ];

the query in the debug bar is:

select * from `prestasafe_erp_customers` where ((lower(id) LIKE '%gu%') or (lower(mail) LIKE '%gu%')) limit 20 offset 0

and i've well 2 results, but not showed in the select, did i missed something ?
Capture d’écran 2020-05-06 à 00 03 33

Capture d’écran 2020-05-06 à 00 04 50

Thanks !

Bug with relations as field in repeater widget

Given I have a form with repeater widget with field user relation [ type=relation-dynamic-dropdown]
And I select some values with autocomplete widget
When I save form and reload form page
Then I expect to see  the same value as selected previously
Actual: This is not working inside repeater

Explanation:

  • Simple fix is required to get widget value from $this->formField->value instead of $model->{$attribute}

Bug with display of multiple instances of widget on the same form

Given I am on the Form with 2 dynamic-relation-dropdown fields
- User field
- Product field
And I choose values for Product relation (second field) with autocomplete 
Then I expect to see list of products
Actual: I see list of users instead of products. 
            E.g. I always see results of the first field.

Explanation:

  • This is due to strange behavior of OctoberCMS AJAX handlers, where variables like $this->valueFrom, $this->formField always pre-populated with the first field.
  • Need to implement workaround to receive field name from additional post parameter.

Bug with display of selected item on form rendering

Given I am on the form with dynamic dropdown field
When I select last record from dynamic dropdown with autocomplete
And I reload the form
Then I expect to see selected record to be displayed in dropdown field
Actual the first record is displayed in dropdown field.

Support of proxy fields in fields.yaml definition

Implement support of proxy fields in fields.yaml:

fields:
    relation[user]:
      label: User via relation proxy field
      type: relation-dynamic-dropdown

Currently it's not going to work, because current implementation depends on field name.

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.