Previous Topic: ca_pam_showDataInTable(result, _id, tableHeader)Next Topic: ca_pam_convertToJavaScriptObject(valueObject)


ca_pam_convertToSimpleArray (objectArray, fieldName)

Creates a simple array of strings from any of more complex JavaScript array of objects.

Input Parameters
objectArray (object)

Specifies a reference to an array of JavaScript objects containing multiple properties.

fieldName (string)

Defines the name of the property in objectArray from which to create the simple array.

Return Value

The array that the method creates is returned.

Example
        var location1 = new Object();
     location1.buildingCode = 10;
   location1.floorCode = 20; 
      var location2 = new Object();
     location2.buildingCode = 100;
   location2.floorCode = 200;
var LocationArray = {location1,location2};

var  floorCodeArray = ca_pam_convertToSimpleArray (LocationArray, ‘floorCode’);

The output of floorCodeArray {20,200}.