본문 바로가기
개발/WEB

[저장용]웹스퀘어 데이터셋 필터

by Strong_옹이 2024. 12. 13.
728x90
반응형

웹스퀘어 데이터셋에 필터걸기

setColumnFilter() 메서드를 사용하여 특정 컬럼의 데이터를 동적으로 필터링

dataList.setColumnFilter({
  type: 'row',
  colIndex: 'columnName',
  key: filterValue,
  condition: 'and'
});

• type: 필터 타입 (‘row’ 사용)
• colIndex: 필터링할 컬럼명
• key: 필터 조건 값
• condition: 필터 조건 (‘and’ 또는 ‘or’)

사용자 정의 함수를 사용한 필터링

var filterFunction = function(cellData, param, rowIndex) {
  if (cellData.indexOf(filterValue) > -1) {
    return true;
  }
  return false;
};

dataList.setColumnFilter({
  type: 'func', 
  colIndex: 'columnName',
  key: filterFunction,
  condition: 'and'
});


필터를 해제하려면 clearFilter() 메서드

dataList.clearFilter();


필터전 초기화 / 필터한 후 초기화해줘야함
필터한 데이터셋을 json으로 자바로전달

728x90
반응형

댓글