These are the boxes im referring to

Boxes,

These are an apex item that ive added through the SQL query in which i create the table, The item which gets created from my query

which ive set to Row selector, As you can see it dosent have a client side condition so that dosnt work, it also cannot accept a STATIC ID for javascript so you have to go and find it which i have done. Ive had a hard time making the item disappear, ive tried both Function and Global Variable Declaration in page JavaScript options as well as the JavaScript Initialization Code in the chart region, Ive also tried adding dynamic actions to execute javascript code

try {
    var columnValue = apex.region("Nivel_Reposicion").widget().interactiveGrid("getActions").getSelectedRecords()[0].data.Nivel_Reposicion;
    var showGrid = columnValue == "Sobrestock";
    var selectorGrid = apex.region("stock_ig_grid_vc_cur").widget();
    if (showGrid) {
        selectorGrid.show();
    } else {
        selectorGrid.hide();
    }

but nothing seems to work Any solutions or recomendations you have im open to hearing them Thank you in advance Matias

1

There are 1 best solutions below

1
Koen Lostrie On

The row selector is heavily integrated with the IG model - don't think you have control over it, but from your description it seems you want to stop the user from doing something (in your case selecting the row) when a value in a column has a certain value. There are a couple of declarative options:

  • On page load you can use an "allowed row operations" column to indicate if a row can be updated. This will not hide the row selector checkbox, but the row can not be updated or deleted (depending on the configuration).
  • Use a custom column of type "Switch". This can be then disabled/enabled in a dynamic action. A column of type checkbox doesn't seem to support the dynamic action enabling/disabling

Hiding a control in an IG row is not something I have seen before - I wonder what kind of functionality you're expecting when a user saves an interactive grid with a hidden control. Enabling/disabling is probably the way to go and indicates very well to the customer (1) what the value is in the cell and (2) if he can update or not.

--UPDATE--

With the additional info that you passed in the comments, this is how you could approach it.

  • Add a custom column of type "Checkbox" - do NOT use the ROWSELECTOR for this
  • Use the "Allowed Row Operations" to have a NULL value for the rows with overstock and "U" for the other rows. That way the rows with overstock will be greyed out. If the other columns of the rows can be updated in case of overstock, then use a dynamic action on page initialization with a column of switch type as described above
  • Use custom DML to process the IG on submit (which you probably are already doing)