Skip to main content
allenp0001
Known Participant
May 28, 2021
Question

Change all rows in an editable grid with same order no

  • May 28, 2021
  • 5 replies
  • 0 views

So I have a requirement to create an interface that allows management to view and prioritize orders.  I have created and editable grid, but the issue is some lines have the same "order no"  and I will need to to automatically change all rows with the same order no as the one that was changed.

Any thoughts?

    5 replies

    harshas2775
    Brainy
    May 28, 2021

    Well, If I understood the problem correctly, this can be done within the saveInto attribute of the Order No column. Apparently, something like this

    a!gridRowLayout(
                contents: {
                  a!integerField(
                    value: fv!item.order_No,
                    saveInto: {
                      fv!item.order_No,
                      a!foreach(
                        local!items,
                        a!save(fv!item.order_No, save!value)
                      )
                    }
                  ),
                 /*Rest of the code*/
            )

    Here local!items hold the data and upon updation on Order No in any row, I am updating the entire data array's Order No to the latest entered Order No.

    Hope this helps!

    allenp0001
    Known Participant
    May 28, 2021

    I am sorry I was unclear.  What I am attempting to do is change a priority order number but it change all rows with the same order number.  For example in the picture, if I change the 3 to a 1 in one row with order number 1255777, then it would change the other 2 rows.

    mikes0011
    Brainy
    May 28, 2021

    Is this functionality supposed to affect just one specific field, or all fields?  If you need to build in a workaround to do this, it should be doable, but if it's going to be bigger than one specific spot, I'd consider taking a different approach.  Especially given that if these rows are supposed to have identical data, then there isn't much point in even having multiple rows as far as I can see.

    Also: did you post a picture?  I don't see a picture in your original post.

    The Expression Guru