Skip to main content
November 18, 2024
Solved

How to disable addRowLink when rows count reach certain limit?

  • November 18, 2024
  • 2 replies
  • 0 views

I have a gridLayout, and I have an addRowLink where user can add row to the grid, I want to have a row counts limit like 10, when there are 10 rows, I want the link to be disabled and user can't add more rows.

How can I disable an addRowLink

    Best answer by konduruc733182

    Hello [mention:2aea1bf0b6954f94815518e79da990c7:e9ed411860ed4f2ba0265705b8793d05] 

    You will not be able to disable the addRowLink. Instead you can hide it, if the length of your data reaches 10 with a simple if() condition. If you want to display the "add new row" text even when the limit is reached and you want to make it disabled, use a rich text display field below your grid and make use of it instead of the addRowLink parameter. 

    addRowlink: if(
              length(local!myRows)>=10,
              {},
              a!dynamicLink(
                label: "Add New Row",
                value:{},
                saveInto:{}
              )
            )

    2 replies

    konduruc733182
    November 18, 2024

    Hello [mention:2aea1bf0b6954f94815518e79da990c7:e9ed411860ed4f2ba0265705b8793d05] 

    You will not be able to disable the addRowLink. Instead you can hide it, if the length of your data reaches 10 with a simple if() condition. If you want to display the "add new row" text even when the limit is reached and you want to make it disabled, use a rich text display field below your grid and make use of it instead of the addRowLink parameter. 

    addRowlink: if(
              length(local!myRows)>=10,
              {},
              a!dynamicLink(
                label: "Add New Row",
                value:{},
                saveInto:{}
              )
            )

    November 18, 2024

    Thank you!