euknyaz / oc-relation-dynamic-dropdown-formwidget Goto Github PK
View Code? Open in Web Editor NEWThis plugin extends OctoberCMS back-end forms with 'relation-dynamic-dropdown' form widget
License: MIT License
This plugin extends OctoberCMS back-end forms with 'relation-dynamic-dropdown' form widget
License: MIT License
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
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
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 ?
Thanks !
Support of emptyOption parameter to display it in search results
fields:
user:
label: Frontend User
comment: 'dynamic search and autocomplete with lazy loading'
span: left
type: relation-dynamic-dropdown
nameFrom: username
emptyOption: None
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:
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:
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.
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.
Support of fields names defined with context like name@update.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.