ng-grid

ngGrid cell value is an enum value, how do I use the enum name?

徘徊边缘 提交于 2019-12-08 09:37:27
问题 This is my ngGrid definition: $scope.notesGrid = { data: 'notes', enableHighlighting: true, enablePinning: false, enableColumnResize: true, keepLastSelected: false, columnDefs: [ {field:'date', displayName:'Date', cellFilter:'date:\'yyyy-MM-dd\'', cellClass:'align-right'}, {field:'noteId', displayName:'Code', cellClass:'align-right'}, {field:'type', displayName:'Sale/Rent'}], selectedItems: $scope.selectedNotes, multiSelect: false, afterSelectionChange: function (rowItem, event) { } }; The

Persist selected rows the correct way

删除回忆录丶 提交于 2019-12-08 07:51:02
问题 I'm trying to make use of ngGrid. The list represents a bunch of items which the users then can select (or not). This selection should be persisted so when the user comes back the grid shows the same selected items as last time. I made a plunker However I've run into a bit of a problem using ngGrid. I'm using afterSelectionChange to save selection changes to the grid. $scope.gridOptions = { data: 'myData', showSelectionCheckbox: true, afterSelectionChange: function(rowItem, event) { // $http.

How to inject $http service into the ng-grid csv export plugin

江枫思渺然 提交于 2019-12-08 03:52:47
问题 I am trying to tackle a TODO in the ng-grid csv export plugin: "add a config option for IE users which takes a URL. That URL should accept a POST request with a JSON encoded object in the payload and return a CSV. This is necessary because IE doesn't let you download from a data-uri link" However, because of my somewhat limited understanding of AngularJS, ng-grid and ng-grid plugins, I am struggling with how to access the $http service (which I need to use to post the data) from within the

ng-grid not working in IE8

久未见 提交于 2019-12-07 22:59:49
问题 I'm going nuts trying to figure out why ng-grid isn't working in IE8. I get this error: Expected identifier, string or number ng-grid-2.0.5.debug.js, line 1535 character 17 . I'm copying an example straight from the ng-grid homepage (all the examples there load correctly, by the way). Anyone have an idea here? I would put up a Plnkr or fiddle, but neither will even load in IE8, so it kind of defeats the purpose. using Angular 1.0.4, jQuery 1.8.1, ng-grid 2.0.5 html <html ng-app="myApp"> <head

AngularJS - Difference between ng-grid and data-ng-grid

心不动则不痛 提交于 2019-12-07 21:09:37
问题 I created a ASP.NET MVC 4 project using AngularJS template available for VS2012. In one of the pages, the grid is coded in html like <div class="grid-style" data-ng-grid="userGrid"> </div> But while searching for a problem with the grid, I see people use like <div class="grid-style" ng-grid="userGrid"> </div> What is the difference between data-ng-grid and ng-grid ? 回答1: Although there's already an answer marked correct for this question, it's worth noting that it's not about browser support

Updating selected rows into ng-grid

烂漫一生 提交于 2019-12-07 18:26:26
问题 I am updating the list of selectedItems but the selections (checkboxes) on the UI are not getting updated for the same. index.html <body ng-controller="MyCtrl"> <div class="gridStyle" ng-grid="gridOptions"></div> <h3>Rows selected</h3> <pre>{{selectedRows}}</pre> <button ng-click="selectAdam()">Select Adam</button> </body> main.js var app = angular.module('myApp', ['ngGrid']); app.controller('MyCtrl', function($scope) { $scope.myData = [{name: "Sam", age: 50}, {name: "Peter", age: 43}, {name:

ngGrid double click row to open pop-up for editing a row

徘徊边缘 提交于 2019-12-07 16:56:03
问题 How would I go about implementing a double-click event in ng-Grid? More particularly, I want the double-clicking to open a pop-up modal(Angular UI Modal) for editing. Any ideas on how to do this? 回答1: In ng-grid 2.0.11, do a simply call to ng-dblclick directive in row template $scope.gridOptions = { data: 'gdDtA', rowTemplate: '<div ng-dblclick="foo(row)" ng-style="{\'cursor\': row.cursor, \'z-index\': col.zIndex() }" ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngCell

ng-grid/ui-grid celltemplate on click causes row to be selected.

别来无恙 提交于 2019-12-07 12:23:30
问题 When I use celltemplate for ahref link, once the link is clicked the row highlights because i have RowSelection enabled...but i dont want the row to highlight when the link is clicked..only if the row is clicked anywhere but the link. Also in my below example picture, how do I remove the little arrow so no Menuitems can be displayed for that column? Code: $scope.gridOptions = { showFooter: true, enableFiltering: true, enableRowSelection: true, enableRowHeaderSelection: false, enableSelectAll:

How to render html formatted content in ng-grid?

≯℡__Kan透↙ 提交于 2019-12-07 08:44:47
问题 I have jsonData which consist of HTML content. I want to render that HTML in ng-grid. The content is not rendered however -- it only shows up in normal string format. Below is the plnkr which shows all the code: http://plnkr.co/edit/RlWyDqCUUR15dmLM7ePV?p=preview 回答1: There's a few things going on here: Not related to your exact issue, but you've got nested single quotes in your firstName field. You need to do some escaping or your ng-click expression is going to break. So instead of ng-click

ng-grid not working in IE8

柔情痞子 提交于 2019-12-06 13:28:16
I'm going nuts trying to figure out why ng-grid isn't working in IE8. I get this error: Expected identifier, string or number ng-grid-2.0.5.debug.js, line 1535 character 17 . I'm copying an example straight from the ng-grid homepage (all the examples there load correctly, by the way). Anyone have an idea here? I would put up a Plnkr or fiddle, but neither will even load in IE8, so it kind of defeats the purpose. using Angular 1.0.4, jQuery 1.8.1, ng-grid 2.0.5 html <html ng-app="myApp"> <head lang="en"> <meta charset="utf-8"> <title>Getting Started With ngGrid Example</title> <link rel=