ng-grid

I need to display an array of strings within ui-grid. Single column, one string per row

故事扮演 提交于 2019-12-24 15:05:11
问题 The REST API I'm calling returns an array in the format: ["a", "b", "c", "d"] And my ui-grid needs to display those data entries in a single column, one per row. I have: $scope.items = []; $scope.gridOptions = { data: 'items' }; And my success callback function within my $http call just sets $scope.items to response.data . This works fine for data in other methods that's received as an array of JSON objects, but in this case where I just get strings, I get the following error in the console

Is it possible to limit ng-grids enabled Cell Selection to one column?

£可爱£侵袭症+ 提交于 2019-12-24 14:26:08
问题 Is it possible to limit the editable modus of ng-grids cells to cells in one column only? I currently use enableCellEditOnFocus: true and this globally allows all cells to be editable . I do have a specific editableCellTemplate for one column, by I would like to have all other columns "readonly" . Any suggestions for a beginner making his first baby-steps with angularjs and ng-grid? This is the relevant setup of the grid currently: var app = angular.module('myCoolGridApp', ['ngGrid']); app

Set cell value based on a condition

为君一笑 提交于 2019-12-24 12:43:39
问题 I have a column binded to a field called state , which has the values: S or L . I want to map this to following: S => Short , L => Long This is how the binding is defined: $scope.gridOptions = { enableSorting: true, enableFiltering: true, enableHorizontalScrollbar: 0, columnDefs: [ {name: 'action', field: 'state', width: 110, enableFiltering: false} ] }; I am already using cellclass and celltemplating , but either one is used for class application or event binding respectively. How do I set

ng-grid doesn't populate with angular $resource

百般思念 提交于 2019-12-24 12:25:43
问题 I'm trying to populate an ng-grid, using and ngResource $resource call, but it seems that the ajax call is always too late, after the ng-grid has already been rendered. The grid renders the headers but is not populated with data. Here's a snippet of the code and a jsfiddle angular.module('api', [ 'ngResource' ]).factory("SERVICE", function($resource) { return $resource('/api/...', {}, { query : { method : 'GET', isArray : true, transformResponse : function(data, headers) { var responsedata =

Angular UI Grid - Custom Header Template and Filtering

我是研究僧i 提交于 2019-12-24 11:54:17
问题 I'm looking for a good example of having a basic filter and having a custom template. I'm having trouble finding a good example on the tutorial sites. See attached plunk where I'm setting filtering and having a custom header template. Does the filtering need to be embedded into the header template? http://plnkr.co/edit/VMETPu30iiFc3GYmZZRS?p=preview var app = angular.module('app', ['ngAnimate', 'ui.grid']); app.controller('MainCtrl', ['$scope', '$http', function ($scope, $http) { $scope

How to create 3 way data binding between angularFire 0.5.0 and latest ng-grid?

与世无争的帅哥 提交于 2019-12-24 05:40:10
问题 angularFire $bind method can be found here : http://angularfire.com/flatdoc.html and latest ng-grid can be found here : http://angular-ui.github.io/ng-grid/ I tried the simplest possible solution but it didnt work : $scope.myData = [{name: "Moroni", age: 50}, {name: "Tiancum", age: 43}, {name: "Jacob", age: 27}, {name: "Nephi", age: 29}, {name: "Enos", age: 34}]; $scope.gridOptions = { data: 'myData', rowTemplate:'<div ng-style="{\'cursor\': row.cursor, \'z-index\': col.zIndex(), \'color\': \

How to create an empty group in ng-grid

爱⌒轻易说出口 提交于 2019-12-24 02:09:10
问题 I know that ng-grid uses aggregation to group rows[1], so it's not officially supported. Is there a nice workaround to create a header of aggregation without a row? Or way to use an empty row and don't display it? I need to aggregate users by group, but I have to list all groups without users too. Something like: Group 1 (users : 5) -User 1 -User 2 -User 3 -User 4 -User 5 Group 2 (users: 0) Group 3 (users: 1) - User 6 [1] How to set aggregation with grouping in ng-grid 来源: https:/

how to edit column in value in angular js?

你离开我真会死。 提交于 2019-12-24 01:19:31
问题 I am using UI-grid in my example .I saw the documentation from here of edit row . http://ui-grid.info/docs/#/tutorial/205_row_editable In given example user able to edit the columns present in row.I also make same example also include modules but not able to edit my columns ..what is procedure to edit the columns ? here is my code http://plnkr.co/edit/zypDrZeJUx9ZoTHNnMxc?p=preview already added the modules angular.module('app',['ngTouch', 'ui.grid', 'ui.grid.selection' ,'ui.grid.edit', 'ui

How can we add a row to an ng-grid and then have that row selected?

那年仲夏 提交于 2019-12-22 09:23:18
问题 My team have been trying the following: $scope.addTest = function () { var TestRow = { "name": "xx", "description": "xx", "subjectId": 15 }; $scope.gridOptions.selectAll() var testRowLength = $scope.gridData.push(TestRow); $scope.gridOptions.selectItem(testRowLength - 1, true); } However the last selectItem does not correctly do a select. So we tried the following: $scope.$apply(function () { $scope.gridData.push(TestRow); $scope.gridOptions.selectItem(testRowLength - 1, true); }); Now we get

UI Grid CSS not working

馋奶兔 提交于 2019-12-22 08:10:10
问题 I tried to create a grid using UI grid (Recent version of ngGrid) which is unstable version and integrated in my current project. It is Not correctly displaying the (icon angle down and row selected icon) as needed While including the CSS file in project (by downloading the file and uploading) its giving me display errors as shown below. But, if i directly give the web url for CSS file in my project...it is displaying correctly. //web url: <link rel="stylesheet" href="http://ui-grid.info