Giter Club home page Giter Club logo

Comments (3)

NeroAzure avatar NeroAzure commented on July 17, 2024 4

@beliolfa It seems like you are still referencing your readOnly attribute inside your vue components, which itself is looking at this.field.readOnly. Meanwhile Nova has its on computed property for that called isReadonly, in which readonly (see the lowercase o) but also this.field.extraAttributes.readonly are looked at, the latter is the property which is set by Nova-fields.

This results in the behaviour that your fields are not displaying as readonly, but behave that way (value does not get saved).

Additionally, the JSON field will save values even when a field inside it has been marked as readonly, as a workaround for our project I extended your JSON-class and changed fillAttributeFromRequest, so that the fields that are readonly get rejected before filling (via ->reject->isReadOnly($request)).

from nova-fields.

beliolfa avatar beliolfa commented on July 17, 2024

Hey @dtannen sorry for the delay I took a little vacation.
Since this PR https://github.com/64robots/nova-fields/pull/167/files we are not redeclaring readOnly anymore so if you use the modifier as described in Nova Docs should work. Can you try and let me know if it works? If not, please, provide reproduction steps and I will try to fix it.
Thanks!

from nova-fields.

beliolfa avatar beliolfa commented on July 17, 2024

Hey @NeroAzure thank you for your detailed solution. It looks like you fixed the issue in your projects. Do you mind opening a PR so I can take a look? If you are busy I will fix it as soon as I can.

from nova-fields.

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.