Unable to Bind array object to the UI-Grid
I have data as bellow :
$scope.gridOptions = {
columnDefs: [
{ name: 'users', displayName:'Users'}
]
};
$scope.gridOptions.data = ["users": [{"ABC","ADF","PQR"}]];
I am unable to display "users" data in single cell.
Any ides, how to solve this?
your code has some error, change the nameto fieldlike this:
$scope.gridOptions = {
columnDefs: [
{ filed: 'users', displayName:'Users'}
]
};
Hi please try this code I just checked it in grid it will work fine
$scope.gridOptions = {
columnDefs: [
{ field: 'Name', displayName:'Users'}
],
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi;
}
};
$scope.gridOptions.data = [{"Name": "ABC"}, {"Name": "ADF"}, {"Name": "PQR"}];
@Vinodang
I think there is no error in my code, its work me for other data, but i am unable to bind Array in single cell.
@shadkhan
yup, let me try :-)
@shadkhan
If i use $scope.gridOptions.data = [{"Name": "ABC"}, {"Name": "ADF"}, {"Name": "PQR"}];
It will create new row for each name, but i am looking all 3 values in single cell like: 'ABC,ADF,PQR'
Some how i done with "cellFilter: " Thank you
@Shreeshag could you please show your fixed code?
I have done with
.filter('users', function() {
....
....
....
....
})