cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Getting the number of field definitions from an infotable

kahmeng96
14-Alexandrite

Getting the number of field definitions from an infotable

Hi all, I am trying to get the number of field definitions from my infotable as shown.

Capture.PNG

In this case, I want the number of field definitions to return 4. I've tried using getFieldCount() but it doesn't seem to work, any help will be greatly appreciated!

ACCEPTED SOLUTION

Accepted Solutions
kahmeng96
14-Alexandrite
(To:Constantine)

Hi @Constantine, thanks for reply. I am actually using an IDE to create a custom widget so your solution might not be applicable. Therefore, I will be using mine as shown in the code below.

this.updateProperty = function (updatePropertyInfo) {
    var widgetProperties = this.properties;
    var dataRows = updatePropertyInfo.ActualDataRows;
    var nRows = dataRows.length;
    var rowData = new Array();
    for (var i = 0; i < nRows; i++) {
        rowData.push(dataRows[i]);
    }
}
console.log(Object.keys(rowData[0]).length); //returns 4

 

View solution in original post

2 REPLIES 2

Hello,

 

There you are:

myProperty.dataShape.fields.size()

 

/ Constantine

kahmeng96
14-Alexandrite
(To:Constantine)

Hi @Constantine, thanks for reply. I am actually using an IDE to create a custom widget so your solution might not be applicable. Therefore, I will be using mine as shown in the code below.

this.updateProperty = function (updatePropertyInfo) {
    var widgetProperties = this.properties;
    var dataRows = updatePropertyInfo.ActualDataRows;
    var nRows = dataRows.length;
    var rowData = new Array();
    for (var i = 0; i < nRows; i++) {
        rowData.push(dataRows[i]);
    }
}
console.log(Object.keys(rowData[0]).length); //returns 4

 

Announcements


Top Tags