ng-grid

basic ng-grid example not working

孤人 提交于 2019-12-10 15:16:06
问题 I'm new to angularjs and ng-grid...I'm currently going through a simple exampe for ng-grid, but I can't seem to get it to work. Here is my html: <!DOCTYPE html> <html ng-app="myApp"> <head lang="en"> <meta charset="utf-8"> <title>Getting Started With ngGrid Example</title> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.css" data-semver="2.0.11" data-require="ng-grid@*" /> <link rel="stylesheet" type="text/css" href="css/style.css" />

Whats the equivalent for ng-grid's “beforeSelectionChange” in ui-grid?

六月ゝ 毕业季﹏ 提交于 2019-12-10 12:55:33
问题 In ng-grid , I used to use beforeSelectionChange in the following way: When the user selects a row, an ajax call is performed. While the ajax call is happenning I set $scope.doingAjaxCall = true , and to prevent the user from changing the selection, I had this in the grid definition: beforeSelectionChange: function () { return !($scope.doingAjaxCall); }, which locks/freezes the selection if the ajax call is happenning. Now, in ui-grid (aka ng-grid 3), I don't know whats the equivalent for

jQuery Sparkline in a cell in ng-grid using CellTemplate and Directive

允我心安 提交于 2019-12-10 10:57:27
问题 I am trying to bring jQuery Sparkline at each row in one cell in ng-grid. The column contains numeric array data. Plunkr --> http://plnkr.co/edit/1eNEcx6FQWcJynlVYvFw?p=preview I am using directive with cell template to achieve this. Cell Template: Directive: app.directive('ngAge', function() { return{ restrict: 'C', replace: true, translude: true, scope: {ngAgeData: '@'}, template: '<div>' + '<div class="sparklines"></div>' + '</div>', link: function(scope,element,attrs){ // var arrvalue=

ng-grid headerRowTemplate - Has anyone used this?

限于喜欢 提交于 2019-12-10 03:41:32
问题 My team are wanting to use this feature of ng-grid. However it does not seem to be documented anywhere. What we would like to do is to put a "plus" icon into the last column of the header area of a ng-grid. Has anyone found a good way to do this? 回答1: Just modify the headerCellTemplate for the last column in your grid (see https://github.com/angular-ui/ng-grid/wiki/Templating). Here is an example (note <img src="PLUS-ICON.png" /> in the second line): var myHeaderCellTemplate = '<div class=

Sort on underlying data in ng-grid

℡╲_俬逩灬. 提交于 2019-12-09 17:46:30
问题 I wish to display a formatted value in a ng-grid cell, but sort on a related numeric value not displayed. var myData1 = [{ name: "Moroni", age: 50, ageWord: "Fifty" } From the above example I would display the ageWord column, but wish to sort on the age column. The docs for sorting an ng-grid directive indicate I can provide a custom function to sort underlying data: sortFn Sets the sort function for the column. Useful when you have data that is formatted in an unusual way or if you want to

Does ng-grid support virtual scrolling?

余生长醉 提交于 2019-12-09 13:15:46
问题 I wanted to use Slickgrid for the grid functionality in my app but since I am using AngularJS for the most part i thought that ng-grid is the way to go but not sure whether it supports virtual scrolling (I tried to look into their documentation and did not find any thing about virtual scrolling support). It would be great if some one could also enlighten me the pros and cons using ng-grid vs slick grid if possible. 回答1: Yes, ng-grid supports row virtualization. You can see in the grid

Why nested ng-grid height does not work?

房东的猫 提交于 2019-12-09 10:01:53
问题 I have a nested ng grid. var faculty = angular.module('faculty', ['ngGrid']); faculty.controller('facultycontroller', function facultycontroller($scope, $http, $window) { $scope.facdata = [{ examname: 'test' },{ examname: 'test2' }]; $scope.gridOptions = { data: 'facdata', plugins: [new ngGridFlexibleHeightPlugin()], columnDefs: [ {field: 'examname',displayName: 'Exam Name'}, {field: '', displayName: 'Subjects' , cellTemplate: '<div ng-grid="gridOptions1" ></div>' }] }; $scope.fac1data = [{

Clear grouping in ng-grid with external button

て烟熏妆下的殇ゞ 提交于 2019-12-08 13:35:03
问题 I have a ng-grid with data that is grouped by category, as shown below: $scope.gridOptions = { columnDefs: [ {field: 'cat', displayName: 'Category'}, {field: 'name', displayName: 'Name'}, {field: 'val', displayName: 'Value'} ], data: 'myData', groups: ['cat'] } I would like to be able to un-group the data in the ng-grid externally with a button. I do not want to display the group panel (via $scope.gridOptions.showGroupPanel: true ), which provides an 'X' to clear the grouping. I have tried

ng-grid how to enable Edit and Delete buttons

丶灬走出姿态 提交于 2019-12-08 11:18:35
问题 I am still new to Angular and learning about the ngGrid. I have a basic ng-grid with some data on schedules. I have Add, Edit and Delete buttons at the bottom of the grid. I want to disable the Edit and Delete buttons by default when the grid is loaded. I would like to enable those buttons when any row from the ng-grid is selected. I have been able to implement this functionality on a HTML table, but not a ng-grid. Here is my HTML. <div class="gridStyle" ng-grid="gridOptions"><!--ng-grid--> <

how to make angularfire send ng-grid onBlur changes to firebase automatically?

落花浮王杯 提交于 2019-12-08 09:54:50
问题 This is a followup question from here: How to create 3 way data binding between angularFire 0.5.0 and latest ng-grid? where Kato nicely provided a solution: var app = angular.module('app', ['firebase', 'ngGrid']); var fb = new Firebase('https://nggrid-example.firebaseio-demo.com/'); app.controller('ctrl', function($firebase, $scope, orderByPriorityFilter) { $scope.data = $firebase(fb); $scope.myData = $firebase(fb); $scope.$watchCollection('data', function() { $scope.myData =