Skip to main content

deleteDSValue

deleteDSValue

Deletes rows at a given position from a list field in the DataSet.

Parameters

  • recordPath (String): The path of the row to delete in the DataSet, including its index (e.g. "ds.list[2]")
  • count (number): The number of rows to delete. Defaults to 1; -1 deletes them all

Returns: booleantrue on success, false if the path is invalid

Description

Removes count rows starting at the given index from the DataSet's list field. Passing -1 for count empties the whole list. Deletions are applied to the DataSet immediately, so bound UI updates right away.

Example

// DataSet ds의 list에서 3번째 행 삭제 (0-based index)
$vm.deleteDSValue("ds.list[2]", 1);

// DataSet 리스트 전체 비우기
$vm.deleteDSValue("ds.list", -1);

// 현재 선택 행(current) 삭제
var cur = $vm.getDSCurrent("ds.list");
$vm.deleteDSValue("ds.list[" + cur + "]", 1);

Related

  • $vm.insertDSValue(recordPath, jsonData) — insert a row at the front of the DataSet list
  • $vm.appendDSValue(recordPath, jsonData) — append a row to the end of the DataSet list
  • $vm.getDSCurrent(path) — read the DataSet's currently selected row index