angular-ui-grid

Angular ui grid, change behavior of “Export all data as csv”

柔情痞子 提交于 2019-12-09 19:55:46
问题 I have a uigrid that contains a large number of column definitions that aren't initially filled with data because the data set would be too large. Instead, I get the requested column data when the column visibility changes. This causes an issue with the built in csv exporter. When someone chooses to "Export all data as csv" they get numerous empty columns. What I would like to do it change the default behavior of the built in csv menu items to use uiGridExporterConstants.VISIBLE. I was going

Pre-Select rows on load with angular-ui-grid

百般思念 提交于 2019-12-09 18:42:31
问题 I want to select certain rows on page load(working days) This is the plunker plnkr.co/edit/48NyxngWNGIlOps1Arew?p=preview Any suggestion? 回答1: Add the following property to your $scope.gridOptions object : onRegisterApi: function(gridApi) { $scope.gridApi = gridApi; $scope.gridApi.grid.modifyRows($scope.gridOptions.data); $scope.gridApi.selection.selectRow($scope.gridOptions.data[0]); } This sets a $scope.gridApi so you can access it if you need it outside of this function. You need to call

ng-click inside cell template does not trigger function in controller

我的梦境 提交于 2019-12-09 14:19:56
问题 I have created a plunker here: http://plnkr.co/edit/zGqouwzxguef13lx48iP?p=preview When I click in a cell of the ui-grid in the day view then nothing happens. What I expected is that the test function is executed and an alert is shown with text 'test' but that is not the case. What is going on wrong here? Thats the html cell template of the ui-grid 3.0 latest release: HTML <div ng-click="test()" ng-switch="row.entity[row.grid.columns.indexOf(col)].isPeriod"> <div ng-switch-when="true">

How to animate Angular ui-grid when rows are added

人走茶凉 提交于 2019-12-09 05:57:57
问题 I have an Angular UI Grid element. I am periodically adding new items at the front of the data array. I'm only adding a few at a time (like 1 to 5 new items) I would like the UI Grid to animate the new rows being added. Right now the rows are added immediately, which makes it jumpy. I want to the new rows to animate in so the UI Grid looks like it smoothly adds them in. Is this easily possible? Is there an option for this? 回答1: It's a bit of a difficult problem because UI-Grid virtualizes the

Inject module dependency (like plugin) only if needed AngularJS

為{幸葍}努か 提交于 2019-12-08 15:58:56
问题 I have 2 pages (I don't use the angular 's routing - This constraint). In one of them I want to use the directive ui-grid like in this demo: var app = angular.module('myApp', ['ui.grid']); app.controller('mainCtrl', function($scope) { $scope.myData = [ { "firstName": "Cox", "lastName": "Carney", "company": "Enormo", "employed": true }, { "firstName": "Lorraine", "lastName": "Wise", "company": "Comveyer", "employed": false }, { "firstName": "Nancy", "lastName": "Waters", "company": "Fuelton",

ui-grid custom directive height not getting updated when i change the data

我的未来我决定 提交于 2019-12-08 11:33:42
问题 I have a UI-grid Custom Directive and I am changing the height of grid with a condition that if it has more than 10 rows I am fixing the height, this is the following code scope.gridOptions.data = scope.data; if (scope.data.length > 10) { scope.gridOptions.minRowsToShow = 10; } else { scope.gridOptions.minRowsToShow = scope.data.length; } scope.gridOptions.virtualizationThreshold =scope.gridOptions.minRowsToShow; by default its working fine but when I change the data the height is not

AngularJS ui-grid import XLSX data best approach

非 Y 不嫁゛ 提交于 2019-12-08 06:44:39
问题 What would be the best approach to import XLSX data to be displayed using an AngularJS ui-grid? Is the js-xlsx parser a good choice for this, or are there other open source XLSX parser tools better suited for this task? In my case the XLSX data is very basic, nothing complicated, but I would like to preserve the style info as much as possible. I anticipate the the data grid will be less than 20 col x 1000 rows. Or would it be better to use an alternative data grid, such as the Hansontable,

dynamic highchart config in angular ui grid with angular js using pablojim's highcharts ng

蓝咒 提交于 2019-12-08 05:08:13
问题 my code (on the controller) to create an angular ui-grid - function getData() { $scope.myData = []; $scope.columnDefs = []; $scope.gridOptions = { data: 'myData', useExternalSorting: true, columnDefs: 'columnDefs', }; valuesService.getValues().success(function (data) { $scope.columnDefs = getColumnDefs(data.DataColumns); $scope.myData = data.Data; if (!$scope.$$phase) $scope.$apply(); }).error(function (error) { $scope.status = 'Unable to load customer data: ' + error.message; }); } function

Angular ui.grid get nested rows

主宰稳场 提交于 2019-12-08 05:04:40
问题 I've tried for the last few hours to get ui.grid to display a nested table inside one row. $scope.gridOptions.columnDefs = [ {name: 'id'}, {name: 'categoryName'}, {name: 'products', cellTemplate: '<div ui-grid="grid.appScope.gridOptions.data"></div>'} ]; Each row can have none, one or multiple products, but I can't get my products to display. I'm requesting the json file via ajax, but for demo purposes I've made it static. Here's the plucker http://plnkr.co/edit/aXgXFZQL4xgVtTNH3y2S?p=preview

In ui-grid, I want to use a function for the colDef's field property. How can I pass in another function as a parameter to it?

佐手、 提交于 2019-12-08 03:52:51
问题 When configuring an Angular ui-grid, you specify the field for each column definition. You can either use a string to point to the right field in the row.entity, or you can use a function. See this github issue for a quick summary of how: https://github.com/angular-ui/ui-grid/issues/723 When specifying the field using a function, I can pass in strings, objects, and arrays as arguments. For some reason, though, it doesn't work when I pass another function. In fact, the primary function to