Editable grid problem

Certified Senior Developer

Hello.

I am working on the editable grid. I want to be able to add multiple row on the same time, with different value. 

But all the row that I add works like one. The result that I got is multiple rows , with the same value. 

What is the problem?

  Discussion posts and replies are publicly visible

Parents
  • What are the different values you want to add to each row? For example, did you want the Skill 1 column to increment (i.e. 1, 2, 3, 4, etc)? The main thing you have to do is update the logic that adds a new row to be dynamic depending on your data. For example, suppose I want to increment the skill like I mentioned above. You could set up your addRowLink like this to dynamically calculate the skill value by counting how many items are in the array:

    a!localVariables(
      local!gridData,
      a!gridLayout(
        ...
        addRowLink: a!dynamicLink(
          label: "Add Row",
          saveInto: a!save(
            target: local!gridData,
            value: append(
              local!gridData, 
              {
                name: "John Doe", 
                skill: if(
                  isnull(local!gridData),
                  1,
                  count(local!gridData) + 1
                )
              }
            )
          )
        )
      )
    )

  • 0
    Certified Senior Developer
    in reply to Peter Lewis

    Thank you for your time The idea was to be able to choose different value for each record, for example The second row I want to choose another name, not Julia...but once I change it ...change in each row. I fix for the moment, I think that it was due to the lack of the index. But still I have an issue: how to display conditionally some columns of the grid? To show if another field in the interface is not null?

Reply
  • 0
    Certified Senior Developer
    in reply to Peter Lewis

    Thank you for your time The idea was to be able to choose different value for each record, for example The second row I want to choose another name, not Julia...but once I change it ...change in each row. I fix for the moment, I think that it was due to the lack of the index. But still I have an issue: how to display conditionally some columns of the grid? To show if another field in the interface is not null?

Children
No Data