Nested JSON in wj flex grid column

Posted by: mail2ravindar on 10 November 2017, 10:59 pm EST

    • Post Options:
    • Link

    Posted 10 November 2017, 10:59 pm EST

    Could you please suggest how can I display contactNm in wijmoflex grid by below nested json object.

    {

    “fileMetadataSearch”: [

    {

    “_id”: “59646b98eaed56a35621882b”,

    “frequency”: {

    “frequencyType”: “WEEKLY”

    },

    “notification”: {

    “contactNm”: “Tom”,

    “emailAddress”: “tom@gmail.com

    }

    }]

  • Posted 12 November 2017, 8:38 pm EST

    Hi,

    For the JSON data :

    {  
       "fileMetadataSearch":[  
          {  
             "_id":"59646b98eaed56a35621882b",
             "frequency":{  
                "frequencyType":"WEEKLY"
             },
             "notification":{  
                "contactNm":"Tom",
                "emailAddress":"tom@gmail.com"
             }
          }
       ]
    }
    

    You need to use the following code snippet for the same:

    <wj-flex-grid items-source="fileMetadataSearch" >
    	<wj-flex-grid-column binding="notification.contactNm" header="Name"></wj-flex-grid-column>
    </wj-flex-grid>
    

    ~Manish

  • Posted 13 November 2017, 10:00 pm EST

    Thanks Manish, i have one more value out of fileMetadataSearch, as shown below.Then how can I access that value (Successrate).

    {

    “fileMetadataSearch”:[

    {

    “_id”:“59646b98eaed56a35621882b”,

    “frequency”:{

    “frequencyType”:“WEEKLY”

    },

    “notification”:{

    “contactNm”:“Tom”,

    emailAddress":"tom@gmail.com

    }

    }

    ],

    “successRate”: 1

    }

  • Posted 14 November 2017, 5:00 pm EST

    Hi,

    The JSON data should be in the following format since fileMetadataSearch is itemsSource for FlexGrid.

    	"fileMetadataSearch": [
    		{
    			"_id": "59646b98eaed56a35621882b",
    			"frequency": {
    				"frequencyType": "WEEKLY"
    			},
    			"notification": {
    				"contactNm": "Tom",
    				"emailAddress": "tom@gmail.com"
    			},
    			"successRate": 1
    		},
    		{...}
    	]
    

    The data should be in nested object format as shown above.

    ~Manish

  • Posted 14 November 2017, 5:25 pm EST

    Thanks Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels