getDataCount
getDataCount
Returns the current row count of a list field in the DataSet.
Parameters
fieldPath(String): The path of the list field in the DataSet (e.g."ds.list")
Returns: number — the list's current row count, or 0 if the path is invalid or not a list type
Example
var count = $vm.getDataCount("ds.list");
$log.i("현재 행 수:", count);
// 마지막 행 인덱스 계산
var lastIndex = $vm.getDataCount("ds.list") - 1;
// 데이터가 있을 때만 처리
if ($vm.getDataCount("ds.list") > 0) {
$vm.setDSCurrent("ds.list", 0);
}
Related
$vm.setDataCount(fieldPath, count)— change the DataSet list's row count$vm.getDSCurrent(path)— read the currently selected row index