• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Edit Grid Focus Field

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

  • Edit Grid Focus Field

    Hello all, I'm working on an app and I'm finding a need for a similar function as a form widget. What I would love to do is focus the field on a record after it's updated. The reason I need this is because based on the behavior of my app, sometimes I need to change some values which then causes me to refresh the edit grid. Once the edit grid is refreshed, the cursor disappears.
    It would be awesome if I could put the cursor in a field after refresh.
    I see the focusRow widget property which is close to what I need, but I'm having trouble setting that with the Edit Grid helper program since I can find a way to identify the row number or RRN of the record that was edited.
    Thanks.

  • #2
    Is this a local data grid?

    Comment


    • #3
      I think so. I'm unsure what other kinds of data grids there are. This is an Edit Grid. I'm using Cell editing and not row editing. I only have 2 fields open for edit.
      image.png?
      When a user types in the Gross Amount and presses tab, the cursor moves to the Line Description field. If I refresh the grid or any other widget in my section, the cursor is lost.
      What I would love to do is set the field focus to the line description field of the row that was changed after a refresh. That would be great. It would save some clicking since I'm trying to emulate what our green screen app does. As you know, my users are going to compare this app to the green screen version we have in place and I'm worried about them complaining about using the mouse.

      Comment


      • #4
        I see. So you are making a back-end program call when gross amount is changed, correct?

        Comment


        • #5
          Yes, Sean. For more context, what I do with the edit grid helper backend RPG program is take the gross amount and then calculate the discount amount and net based on the terms for a vendor. In the first line, I am able to accomplish this exactly the way I would like using the backend and the applyData and SetValue procedures. After I tab out of the gross amount, the cursor is positioned in the line description field and the discount and net amounts are updated. I'm having trouble on the second line.
          On the second line, the discount amount is adjusted based on the next gross amount, I can use applyData and setValues for the second line, but I have to use SQL to update the first line values, and I can only get those values to display if I refresh the grid. Once I refreshed the grid, I lost cursor focus.
          It would be great to be able to use setValues and define other records to update and/or be able to set field focus after I refresh the grid.
          Hopefully this helps.
          Thanks.

          Comment


          • #6
            Thanks for the detailed explanations. Will take a closer look and see what we can come up with.

            Comment


            • #7
              After speaking on a phone call it was decided that the "local data" option on the edit grid would be best.
              This will allow you to add/update rows without having to refresh the list.

              Comment

              Working...
              X