skip to Main Content

I have page item in my Interactive Grid (IG) that dynamically updates the row count using a model subscription. When a new row is added, the count increases, and if a row is marked for deletion, the count decreases by 1. However, if a row is only marked for deletion, it still exists in the IG and will be counted when adding a new row. If I have 2 rows and delete 1, the row count drops to 1. When adding a new row, it increases to 3. I want it to be 2, excluding rows marked for deletion. Is it feasible to omit rows chosen for deletion or find an alternate solution to achieve the required functionality?

2

Answers


  1. You can inspect from the record metadata if a record is marked for deletion.

    Example, when you have an employee record with empno ‘7902’, which is the primary key:

    let model = apex.region('ig_emp').call('getViews').grid.model;
    let isDeleted = model.getRecordMetadata('7902').deleted || false;
    
    Login or Signup to reply.
  2. You stated "that dynamically updates the row count" but… there is no code in your question. So it’s impossible to show you how to fix your code.
    What you could do is have a look at page 5 in the IG Cookbook v6 (download in [this blog])(https://hardlikesoftware.com/weblog/2019/11/04/apex-ig-cookbook-update-for-19-2/). That is a sample app released by the John Snyders from the APEX team with some complex examples. This page shows an IG column total in a page item which is similar to what you’re explaining – I’m pretty sure you can just copy that code and make some minor changes to suit your needs.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search