AngularJS : ui grid show multi lines in a cell -


i trying display multiple phone numbers in 1 cell . want display each number in new line . have tried multiple ways unable figure out. can . below link plnkr .

http://plnkr.co/edit/lxdidqooayqoo5bw02wr?p=preview

.filter('phonelistfilter', function () {     return function (telephonelist) {         var telephonearray = [];          (var in telephonelist) {                 telephonearray.push(telephonelist[i]);         }         return telephonearray.join('<br>');     }; }) 

you can achieve having custom template , repeat on number of phone numbers have.

app.controller('mainctrl', ['$scope', '$http', function ($scope, $http) {   $scope.gridoptions = {     rowheight:50,     columndefs: [       { field: 'name' },       { field: 'phonelist', name: 'phone numbers', celltemplate:'<div ng-repeat="item in row.entity[col.field]">{{item}}</div>'}     ],      enablecolumnresizing: true   };    $http.get('data.json')   .success(function (data) {     $scope.gridoptions.data = data;   }); }]); 

the height may become issue. take @ plnkr http://plnkr.co/edit/c65czm19bgjbwfzt15u6?p=preview


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -