Code Monkey home page Code Monkey logo

Comments (10)

sixlive avatar sixlive commented on September 3, 2024

It is currently not possible but I'm willing to implement it. I'll take a look later this week or this weekend!

from nova-text-copy-field.

pritchard67 avatar pritchard67 commented on September 3, 2024

from nova-text-copy-field.

sixlive avatar sixlive commented on September 3, 2024

I ended up going down a rabbit hole trying to get this thing tested. I'll work on getting these couple open features merged and tagged over the next couple of days.

from nova-text-copy-field.

pritchard67 avatar pritchard67 commented on September 3, 2024

from nova-text-copy-field.

sixlive avatar sixlive commented on September 3, 2024

@pritchard67 can you take a look at #26 and make sure its what you are looking for?

from nova-text-copy-field.

pritchard67 avatar pritchard67 commented on September 3, 2024

from nova-text-copy-field.

mikhailkozlov avatar mikhailkozlov commented on September 3, 2024

@sixlive I like it. Megre it!

from nova-text-copy-field.

pritchard67 avatar pritchard67 commented on September 3, 2024

from nova-text-copy-field.

bernhardh avatar bernhardh commented on September 3, 2024

Maybe I am blind: On detail and index, everything works fine, but on the form field, nothing is show. This is my Field definition:

TextCopy::make('Tag', function($item) {
    return '{{ diashow(' . $item->id . ',"u") }}';
})->showOnUpdating(true),

I am currently on v1.5.0:

$composer show | grep copy-field
sixlive/nova-text-copy-field                  v1.5.0             Laravel Nova text field with click to copy support

from nova-text-copy-field.

bernhardh avatar bernhardh commented on September 3, 2024

Ok, its because ComputedField aren't shown on forms (see nova/ResolvesFields::removeNonUpdateFields).

If I now use the other syntax:

TextCopy::make('Tag')
    ->copyValue(function () {
        return '{{ diashow(' . $this->id . ',"u") }}';
    }),

it "works" somehow. It shows me an empty Input field with the copy icon. I can copy the correct value which I would expect. I can hide the input field by css, which would be OK, but I cant save the form, since Nova tries to store now the none existing field "tag" (since now its not a ComputedField anymore).

Edit:

Ok, if I add ->readonly(true), than it works. Kind of hacky, but it works.

from nova-text-copy-field.

Related Issues (19)

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.