-
Notifications
You must be signed in to change notification settings - Fork 0
Noodle GetValue() Method
Dan Kranz edited this page Oct 7, 2021
·
5 revisions
Get a value from the dataset. Pages, lines and columns (fields) are numbered, starting with 1. Use a line number of 0 to obtain header field values. Specify both page and line to return columnar values.
Define a LineValue function in the data source to customize GetValue.
GetValue(page, line, bfi)
Parameter | Description |
---|---|
page | Page number in data view |
line | Line number in page |
bfi | Field index |
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();
// Get a columnar value
var page = 1;
var line = 1;
var bfi = 3;
var text = db1.GetValue(page, line, bfi); // text = “Bird”
// Get a header value
page = 2;
bfi = 2;
text = db1.GetValue(page, 0, bfi); // text = “Mineral”