This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal. |
Hi,
I've tried too many time to fill the returned data into segment, but it doesn't work!
*Returned Data from API:
{
"Category": [
{
"name": "Gift Ideas"
},
{
"name": "TV & Home Theater"
},
{
"name": "TVs"
},
{
"name": "All Flat-Screen TVs"
},
{
"name": "TV/DVD Combos"
},
{
"name": "Blu-ray & DVD Players"
},
{
"name": "Blu-ray Players"
},
{
"name": "DVD Players"
},
{
"name": "Digital TV Tuners & Converters"
},
{
"name": "TV & Internet Service Providers"
}
],
"opstatus": 0,
"httpStatusCode": 200
}
My Code:
function operationSuccess(res){
var response = res.Category;
this.view.SegCategoryList.widgetDataMap={lblname :"name"};
CategoryList = [];
for (var i=0; i < response.length; i++){
dummyArray={};
dummyArray.name=response[i].name;
CategoryList.push(dummyArray);
}
this.view.SegCategoryList.setData(CategoryList);
}
Console Error:
Uncaught TypeError: Cannot set property 'widgetDataMap' of undefined
Uncaught TypeError: depMaps.slice is not a function
Is there any solution for this issue ?!