It is currently 21 April 2025, 18:33 Advanced search

How to Disable entire row?

Questions and answers on how to best use Instant Developer

How to Disable entire row?

Postby Gaby_h » 28 August 2013, 1:23

Suppose I have 10 fields in a panel and need to prevent modifications in rows where State="MA". Currently I am disabling the 10 fields 1 by 1. Is there a way to disable entire rows?
Gaby_h
 
Posts: 888
Joined: 17 July 2013, 18:22
Location: Vancouver, Canada

Re: How to Disable entire row?

Postby g.lanzi » 28 August 2013, 15:29

There is not a function that enables you to disable the row, but you can easly write it :) Something like that:

Code: Select all
procedure void SetRowEnabled(IDPanel pan, boolean enabled)
{
  for (int i = 1; i <= pan.FieldsCount; i++)
  {
    pan.setFieldEnabled(i, enabled);
  }
}


I would use it in the panel.onDynamicProperties event.

Code: Select all
if (field == "MA")
{
    SetRowEnabled(panel.IDPanel(), false);
}
Giuseppe Lanzi
Director of Support services
Pro Gamma S.p.A.
User avatar
g.lanzi
Pro Gamma
Pro Gamma
 
Posts: 3503
Joined: 29 September 2010, 10:24
Location: Bologna

Re: How to Disable entire row?

Postby Gaby_h » 28 August 2013, 16:53

Thanks Giuseppe, that's good.
Gaby_h
 
Posts: 888
Joined: 17 July 2013, 18:22
Location: Vancouver, Canada


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 15 guests

cron