Announcement

Collapse
No announcement yet.

Dynamic Forms

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic Forms

    We can hide/show panels based on another field's value.

    How to give condition as logged in user team there?

    I need to make some panels hidden for some users based on their team.

    Please help.

    Thanks in advance.

  • #2
    In role we can set read/write roles of only fields ryt?

    How to manage panels this way?

    Comment


    • #3
      Hello
      In recordView detail you can hidePanel or showPanel. Set your condition. It could be user field (this.getUser().get('fieldname')) or acl (this.getAcl().checkModel(this.model, 'stream', true)
      read src/views/record/detail.js and detail-bottom.js

      Comment


      • #4
        I tried this.hidePanel("Payment"); in src/views/record/detail.js inside setup()

        Giving me error-
        Uncaught TypeError: Cannot read property 'setPanelStateParam' of undefined
        at n.hidePanel

        Comment


        • #5
          If I write this.hidePanel("Payment"); in afterRender() there is no error.

          But it never hides the Payment panel.

          Am I doing some mistake?

          Please help.

          Comment


          • #6
            selector this.$el.find('.panel[data-name="'+name+'"]')
            check data-name attribute for your panel

            Comment


            • #7
              Sorry, I couldn't see data-name attribute.

              Click image for larger version

Name:	panel.png
Views:	305
Size:	9.0 KB
ID:	33788

              This is all what I see.

              Tried- this.$el.find('.panel[data-name="Payment"]').addClass("hidden"); // Not working

              Comment


              • #8
                you panel has no data-name attribute. add to panel definition the name (in clientDefs or where you added it)

                Comment


                • #9
                  I am so happy Thank you so much Tanya. It worked.

                  Comment

                  Working...
                  X