Giter Club home page Giter Club logo

Comments (6)

zofe avatar zofe commented on May 21, 2024

updated
hi, basically not for "all" fields and not for all kind of "relation", but can be done (for some).
see below

from rapyd-laravel.

zofe avatar zofe commented on May 21, 2024

it already works on belongsTo relations because internally it works on foreingKey:
see "Author" autocomplete: http://www.rapyd.com/rapyd-demo/filter
It filter by author_id, but using author.fullname as fieldname where:
"author" is the relation
"fullname" is a simple accessor (look one demo models)

to know how autocomplete works, if it's not intuitive, look on http://www.rapyd.com/rapyd-demo/advancedform

from rapyd-laravel.

zofe avatar zofe commented on May 21, 2024

ok now it should work also for:
hasOne, hasMany, belongsToMany

from rapyd-laravel.

larylinz avatar larylinz commented on May 21, 2024

thxs! looks great! (changed to dev-master now)
got the filter and autocomplete now! :-)
but how to save realted fields? $edit->add('contact.lastname','name', 'text'); ?
it gives me the 'id' of the related row (like 'contact.id') and i'm able to change it, but i'd like to change for example 'lastname'.
how to do that?

from rapyd-laravel.

zofe avatar zofe commented on May 21, 2024

I'm working on that, but basically for now to store values:

  • it looks at relation-type first (so "contact."),
  • if relation is a "belongsTo" it try to store the foreign key value, ".field" is used only as display value
  • if relation is a "belongsToMany" it works on pivot table retrieving / storing associations, again ".field" is used only as display value
  • I plan to support "hasOne" too asap. (in this case it will store "lastname" value on contact table)

these samples are on demo / datafilter adv

from rapyd-laravel.

zofe avatar zofe commented on May 21, 2024

ok I close this issue because:

  • datafilter now can handle HasOne, HasMany, BelongsTo, BelongsToMany
  • field supported: text (HasOne, HasMany), select, radiogroup, autocomplete (BelongsTo), tags (BelongsToMany)

It's not all tested but feel free to open a new issue (but be specific: field-type relation-type).
Note: it works only for first level relationship. (you can't use 'relation.anotherrelation.field')

from rapyd-laravel.

Related Issues (20)

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.