Giter VIP home page Giter VIP logo

Comments (8)

davidlgj avatar davidlgj commented on May 11, 2024 1

Sure! I think you can sort of do it already with formDefaults in globalOptions, but it's a good idea.

from angular-schema-form.

mike-marcacci avatar mike-marcacci commented on May 11, 2024

That's an excellent alternative! Unfortunately, though, I'm not having any luck with it:

<form sf-model="data" sf-form="form" sf-schema="schema" sf-options="{ formDefaults: { readonly: true } }"></form>

Is this how it might be specified?

Thanks for the lightning-quick response!

from angular-schema-form.

mike-marcacci avatar mike-marcacci commented on May 11, 2024

Haha, never mind – I found an error on my end :) I'm more than happy calling this one closed. Thanks again for the help!

from angular-schema-form.

mike-marcacci avatar mike-marcacci commented on May 11, 2024

Actually... that bug wasn't exactly on my end. sfOptions should be evaluated in the presence of the user's scope. This lets us specify the options dynamically. PR coming...

from angular-schema-form.

fiddur avatar fiddur commented on May 11, 2024

Actually, read-only on an object (as in top-level schema) should make everything in that object read only, since changing anything in that object should be prohibited.

from angular-schema-form.

davidlgj avatar davidlgj commented on May 11, 2024

Should be fixed whenever #61 is fixed...

from angular-schema-form.

deepkamal avatar deepkamal commented on May 11, 2024

formObject.schemaOptions.formDefaults.readOnly = true makes entire form readonly

its already there, unless am missing something?

from angular-schema-form.

kupuguy avatar kupuguy commented on May 11, 2024

@deepkamal I think what you're missing is that while setting formObject.schemaOptions.formDefaults.readOnly = true does indeed make the form readOnly there is then no easy way to make it editable again. Setting it to false' and triggering theschemaFormRedrawevent doesn't have any effect as thereadonlyattribute has been set on each field and onlyreadOnly=truevalue is inherited fromformDefaults,readOnly=false` is ignored (as indeed it should be).

from angular-schema-form.

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.