6 Replies Latest reply on Feb 17, 2016 10:17 PM by lwei RSS
    lwei Explorer

    Creating InfoTable Problem

    Hi, guys!

    I've got some problems when I create a infotable.

    Here is the following service I use:

     

    var infotable1Object = {dataShape: {fieldDefinitions :{} }, rows: [] };

    infotable1Object.datashape.fieldDefinitions['name']={name: 'name', baseType: 'STRING'};

    infotable1Object.datashape.fieldDefinitions['value']={name: 'value', baseType: 'STRING'};


    var newROW= new Object();

    newROW.name="abcde";

    newROW.value="12345";

    infotable1Object.rows[0]=newROW;

     

    var params = {

      json: infotableObject /* JSON */

    };


    // result: INFOTABLE

    var result = Resources["InfoTableFunctions"].FromJSON(params);

     

     

    the result is always:

     

    TypeError: Cannot read property "fieldDefinitions" from undefined (CreateInfo#1)