20230308 - IG 다른 컬럼 조건에 따른 컬럼 읽기 전용 셋팅

우선 ROW_OPERATION 이라는 항목을 두어서 DB에서 읽어온 데이터는 'U'라는 값을 가져오도록 했고 새로 입력하게 되는 레코드는 아무런 값이 없는 상태로 아래 이미지 설정 Allowed Operations 값에 따르면 추가/수정/삭제 모두 가능해야하지만 그 아래 Allowed Row Operations Column 에 따라서 1) 수정만 가능하게 2)삭제만 가능하게 3)둘 다 모두 가능하게 만들수도 있는데 현재는 읽어온 데이터는 수정만 가능하게 하는 설정


U : Row can be updated

D : Row can be deleted

UD : Row can be updated or deleted


     , qty_a
     , qty_a_r
     , qty_a_d
     , qty_b
     , qty_b_r
     , qty_b_d
     , pid
     , 'U' row_operation



그렇게하여 수정을 가능하게 되어도 해당 레코드 항목 중에서도 상품명은 수정할 수 없도록 추가 설정




읽기 전용 Read Only를 설정할 때 Item을 선택하였음에도 (통상적으로 페이지 아이템) IG 내의 컬럼 이름을 입력하여 처리가 가능하고 Execute : For Each Row로 셋팅

Execute 설명은 아래 참고


Execute
Select when this read only condition is executed.

If you refer to Columns in your read only condition, you must specify For Each Row in order for the condition to be evaluated for each row of the Interactive Grid. Otherwise, set to Once to evaluate the condition only one time for the region.

Available options include
For Each Row : Evaluate the read only condition independently for each row.
Once : Evaluate the read only condition only once for the whole region.



참고

https://www.insum.ca/how-to-set-specific-cells-of-interactive-grids-to-read-only/


댓글 없음:

댓글 쓰기

20250202 - IG 다운로드 버튼 바로 보이기

JS initialization Code : function (config) {     var $ = apex.jQuery,         toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),  ...