ng-click doesn't work in angular-ui-grid


username

I'm trying to fire a click event when a cell in ui-grid is clicked but ng-click is not working. Also ng-class doesn't work, I can't get width: "*" works fine. Does anyone know any accurate documentation for angular-ui-grid ? I am using angular v 1.5.11 and angular-ui-grid v 4.2.3. It seems that half of the functionality of ui-grid is not working and the documentation doesn't seem to explain why.

{ name: 'Number of Vendor Parts', field: 'xrefCount', enableFiltering: false,
      cellTemplate: '<div ng-class="{inactive: row.entity.active === \'N\'}" ' +
                         'ng-click="grid.appScope.showCrossReference()">' +
                      '<a>{{ row.entity.xrefCount }}</a>' +
                    '</div>'
    }
A1t0r

Look at this dwarf . I think your problem is that you are not adding the controller after grid.appScope . If you declare your controller like this:

ng-controller="MainCtrl as main"

The expression for ng-click should look like this:

grid.appScope.main.showCrossReference(grid, row)

Note that you can pass the grid and the row of the button clicked to the function.

As you can see in ng-class 's plugin, I use a function that returns the name of the css class with the row parameter .

Related


ng-click doesn't work in angular-ui-grid

username I'm trying to fire a click event when a cell in ui-grid is clicked but ng-click is not working. Also ng-class doesn't work, I can't get width: "*" works fine. Does anyone know any accurate documentation for angular-ui-grid ? I am using angular v 1.5.1

ng-click doesn't work in angular-ui-grid

username I'm trying to fire a click event when a cell in ui-grid is clicked but ng-click is not working. Also ng-class doesn't work, I can't get width: "*" works fine. Does anyone know any accurate documentation for angular-ui-grid ? I am using angular v 1.5.1

ng-click in Angularjs ui-grid cell template doesn't work

Tuximo I don't know why ng-click doesn't work with the following template: <div> <md-icon ng-click="console.log('hello'); $event.stopPropagation();" md-font-icon layout-fill ng- class="md-raised inline-icon fa statusCellIcon" style="z-index:1000;"> </

AngularJS ES6 ui-grid directive scope, ng-click doesn't work

Torsten Lintren I have a chain directive with angularJS and ES6 and want to use ui-grid. The grid shows the correct columns and data, that's fine. But ng-click doesn't work in cellTemplate. Nothing happened. I also tried checking the grid object with console.l

AngularJS ES6 ui-grid directive scope, ng-click doesn't work

Thorsten Rintelen I have a chain directive with angularJS and ES6 and want to use ui-grid. The grid shows the correct columns and data, that's ok. But ng-click doesn't work in cellTemplate. Nothing happened. I also tried checking the grid object with console.l

AngularJS ES6 ui-grid directive scope, ng-click doesn't work

Thorsten Rintelen I have a chain directive with angularJS and ES6 and want to use ui-grid. The grid shows the correct columns and data, that's ok. But ng-click doesn't work in cellTemplate. Nothing happened. I also tried checking the grid object with console.l

cellClass doesn't work with angular ui grid

shadowhunter_077 Here is my code: for (var i = 0; i < gridData.length; i++) { var currentData = gridData $.each(currentData, function(key, value) { if (!angular.isFunction(value)) { $scope.columnDefs.push({ name : ke

cellClass doesn't work with angular ui grid

shadowhunter_077 Here is my code: for (var i = 0; i < gridData.length; i++) { var currentData = gridData $.each(currentData, function(key, value) { if (!angular.isFunction(value)) { $scope.columnDefs.push({ name : ke

cellClass doesn't work with angular ui grid

shadowhunter_077 Here is my code: for (var i = 0; i < gridData.length; i++) { var currentData = gridData $.each(currentData, function(key, value) { if (!angular.isFunction(value)) { $scope.columnDefs.push({ name : ke

cellClass doesn't work with angular ui grid

shadowhunter_077 Here is my code: for (var i = 0; i < gridData.length; i++) { var currentData = gridData $.each(currentData, function(key, value) { if (!angular.isFunction(value)) { $scope.columnDefs.push({ name : ke

cellClass doesn't work with angular ui grid

shadowhunter_077 Here is my code: for (var i = 0; i < gridData.length; i++) { var currentData = gridData $.each(currentData, function(key, value) { if (!angular.isFunction(value)) { $scope.columnDefs.push({ name : ke

cellClass doesn't work with angular ui grid

shadowhunter_077 Here is my code: for (var i = 0; i < gridData.length; i++) { var currentData = gridData $.each(currentData, function(key, value) { if (!angular.isFunction(value)) { $scope.columnDefs.push({ name : ke

ng-change doesn't work with custom ui-grid

Banuchandar Chara There is a custom ui-grid defined in base.js app.directive('stkGrid', ['$window', '$timeout', function($window, $timeout) { return { restrict: 'E', transclude: true, scope: { data: '=',

Angular ng-click doesn't work with $compile

freddy83 I have code similar to the following code to trigger events in an clickAngular app . Why doesn't the event fire? var app = angular.module("myApp", []) app.directive('myTop',function($compile) { return { restrict: 'E', template: '<div></div>',

Angular toggle variable in ng-click doesn't work

amnesia I have a table that lists customers, and for customers that also have a list of customers, the user can click on the table row to display that list. HTML looks like this: <tbody ng-repeat ="item in customers | clientSettingsFilter:customerId">

Angular-js: ng-click doesn't work

Shiva Since I'm very new to angular js, I'm trying to develop small applications, but I'm stuck because ng-click is not working. please help. Thanks in advance. Here is my code: HTML file: <html ng-app="MyApp"> <head> <title>Angular Demo App</title>

ng-click doesn't work in angular js

Himanshu N Tatariya I am using Angular js from one of my projects and calling the "ng-click" function as follows <a ng-click="logout'{{x.ParentEntityId['#text']}}')" target="_blank">{{x.Title["#text"]}}</a> In "x.ParentEntityId['#text']" the value is "7560183

Angular ng-click doesn't work with $compile

freddy83 I have code similar to the following code to trigger events in an clickAngular app . Why doesn't the event fire? var app = angular.module("myApp", []) app.directive('myTop',function($compile) { return { restrict: 'E', template: '<div></div>',

Angular ng-click doesn't work with $compile

freddy83 I have code similar to the following code to trigger events in an clickAngular app . Why doesn't the event fire? var app = angular.module("myApp", []) app.directive('myTop',function($compile) { return { restrict: 'E', template: '<div></div>',

Angular-js: ng-click doesn't work

Shiva Since I'm very new to angular js, I'm trying to develop small applications, but I'm stuck because ng-click is not working. please help. Thanks in advance. Here is my code: HTML file: <html ng-app="MyApp"> <head> <title>Angular Demo App</title>

Angular JS ng-click doesn't work in child element

Tantrop I'm trying to toggle a variable when an element in the DOM is clicked, but I'm getting some weird behavior. Full example is here Essentially, if I click ng on the .options div and then leave the controller on the .options-tab div, the event fires (but

Angular toggle variable in ng-click doesn't work

amnesia I have a table that lists customers, and for customers that also have a list of customers, the user can click on the table row to display that list. HTML looks like this: <tbody ng-repeat ="item in customers | clientSettingsFilter:customerId">

Calling function with angular ng-click doesn't work

Program 345 I am trying to switch the view from one page to another when a button is pressed. I'm using ng-click but it doesn't switch views when the button is pressed .js file $scope.onCreateAppointment = function () { $scope.templates.myTempla

ng-click doesn't work in angular js

Himanshu N Tatariya I am using Angular js from one of my projects and calling the "ng-click" function as follows <a ng-click="logout'{{x.ParentEntityId['#text']}}')" target="_blank">{{x.Title["#text"]}}</a> In "x.ParentEntityId['#text']" the value is "7560183

Angular ng-click doesn't work with $compile

freddy83 I have code similar to the following code to trigger events in an clickAngular app . Why doesn't the event fire? var app = angular.module("myApp", []) app.directive('myTop',function($compile) { return { restrict: 'E', template: '<div></div>',

Angular ng-click doesn't work with $compile

freddy83 I have code similar to the following code to trigger events in an clickAngular app . Why doesn't the event fire? var app = angular.module("myApp", []) app.directive('myTop',function($compile) { return { restrict: 'E', template: '<div></div>',