How to hide & unhide the grid from the page by using people code?

How to hide & unhide the grid from the page by using people code?

In the given example, user wants to hide and unhide the grid from the page by selecting the check box option on the page. If the check box is checked the grid should be visible else hide the grid & delete the values present in the grid.The check box is at level 0 & the grid is at level 1.

Function HideAllRows() can be used to hide the grid, & function ShowAllRows() can be used to unhide the grid.

HideAllRows hides all rows of the rowset.
For the given example, write the below people code at field change of check box.

1) Hide the grid.

   &Rowset0 = GetLevel0();
   &Row0 = &Rowset0(1);
   &Rowset1 = &Row0.GetRowset(Scroll.);
   &Rowset1.HideAllRows();

2) Delete the data from the grid

   &Rowset0 = GetLevel0();
   &Row0 = &Rowset0(1);
   &Rowset1 = &Row0.GetRowset(Scroll.);
   For &i = &Rowset1.ActiveRowCount To 1 Step - 1
      &Rowset1.DeleteRow(&i);
   End-For;

OR

If the data is present in the component buffer & not present in the data base, then use function flush() to delete the data from the buffer.

   &Rowset0 = GetLevel0();
   &Row0 = &Rowset0(1);
   &Rowset1 = &Row0.GetRowset(Scroll.);
   &Rowset1.flush();

3) Unhide the grid

   &Rowset0 = GetLevel0();
   &Row0 = &Rowset0(1);
   &Rowset1 = &Row0.GetRowset(Scroll.);
   &Rowset1.ShowAllRows();
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值