Skip to main content

setDataCount

setDataCount

Changes the row count of a list block to the given count.

Parameters

  • fieldPath (String): The data path of the list block (e.g. "ds.list")
  • count (number): The new row count (a negative value does nothing)

Returns: None (void)

Description

If the new count is larger than the current row count, empty rows are appended; if it is smaller, rows are trimmed from the end. When current falls outside the new count range, it is automatically reset to -1.

Example

// ds.list를 10행으로 설정
$vm.setDataCount("ds.list", 10);

// 현재 행 수 확인 후 조정
var count = $vm.getDataCount("ds.list");
$log.i("현재 행 수:", count);
$vm.setDataCount("ds.list", count + 1);

Related

  • $vm.getDataCount(fieldPath) — read the current row count
  • $vm.appendDSValue(recordPath, jsonData) — append a row to the list