Skip to content

Noodle ResetPrune() Method

Dan Kranz edited this page Sep 1, 2021 · 1 revision

Remove all prune sets. All rows not "Deleted" are set to "Active" and shown in the data view.

Syntax

ResetPrune()

Parameter Values

None

Example

var items = [
  ["1","Vegetable","Tree","1"],
  ["2","Animal","Bird","1"],
  ["3","Mineral","Diamond","1"],
  ["4","Vegetable","Flower","1"],
  ["5","Vegetable","Grass","1"],
  ["6","Animal","Cat","1"],
  ["7","Animal","Dog","1"],
  ["8","Mineral","Ruby","1"],
  ["9","Mineral","Quartz","1"]
];
var db1 = new Noodle(items, ["Seq","Category","Item","Count"]);

// Create a new data view, Items by Category
db1.InitializeView();
db1.EnterHeader(2);
db1.EnterColumnar(3);
db1.GenerateView();

// Select all rows with Category = "Vegetable"
// Save (mark) the matching rows in the "keep" set bitstring
if (db1.PruneBracket(0, "value", 2, "Vegetable", {"match": "keep"}))
  return;

// Apply the prune.  Only rows within the "keep" set are shown in the view.
if (db1.ApplyPrune("keep"))
  return;

// Remove the prune.  All rows are shown in the view.
db1.ResetPrune();
Clone this wiki locally