Skip to content

Noodle GetDataType() Method

Dan Kranz edited this page Sep 20, 2021 · 2 revisions

A call to GetDataType returns "String" unless the data source has an override function.

Implement a GetDataType method in the data source to customize GetDataType.

Syntax

GetDataType(bfi)

Parameter Values

Parameter Description
bfi Field index

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"]);

// Get the Item column's type
var type = db1.GetDataType(3);  // Returns "String"
Clone this wiki locally