angular-ui-grid

Button click does not work in Celltemplate angular grid

╄→гoц情女王★ 提交于 2019-12-31 04:01:12
问题 I m trying to work with celltemplate. But click event did not work. $scope.format = function(val){ return val.replace(/\//g, ""); }; var executionColumns = { data: [], enableSorting: true, paginationPageSizes: [25, 50, 75], paginationPageSize: 25, enableColumnMenu: true, enableFiltering: true, columnDefs: [ { field: 'StartDate', cellTemplate: '<button ng-click="format (row.entity)">log</button>' }, { field: 'Status' }, ] }; So what should I do? What is the wrong? 回答1: It works for me like the

Angular UI Grid click row

北城以北 提交于 2019-12-30 02:51:10
问题 I have a list of items in an Angular UI Grid. When I click a row, I want to be taken to a different page. (In other words, each row in the grid will be a link.) I imagine this must be a very common desire, although I haven't really seen any documentation on how to do it. What's a good way to accomplish this? 回答1: I figured out the answer myself. Here's my controller (ES6): 'use strict'; class TrackingRecordsCtrl { constructor($scope) { // The content of this template is included // separately

How to highlight the current row when cell template button is clicked in angualar UI Grid

流过昼夜 提交于 2019-12-25 08:26:50
问题 I have enabled ui-grid-selection on grid.As a result that when row is selected it will be get highlighted but my requirement is that i want to highlight the row only when the cell template button is clicked.Please let me know how to do this. Code Sample 回答1: Finally was able to find a way to do that.Here is the answer. What i did was, In grid option changed enableRowSelection: false . Add a function to cell template button. Button Cell Template <div><button class="btn btn-default" ng-click=

ui cell template needs dynamic ng style

萝らか妹 提交于 2019-12-25 07:59:48
问题 In angularjs ui grid, I have the cell template as shown below : cellTemplate : "<div class="progress"> <div class="progress-bar progress-bar-info" ></div> </div>" Now I need to dynamically change the color class for the cellTemplate i.e., progress-bar-info . Based column value (complete, incomplete, in progress or fail) I need to have progress-bar-success, progress-bar-info, progress-bar-warning, progress-bar-danger in the cellTemplate. How can we achieve it? I tried the following template

JSON parser doesn't work with Angular ng-repeat

∥☆過路亽.° 提交于 2019-12-25 05:53:17
问题 I am trying to access json obj and set values into Angular Ui-grid.But the problem was that some of my json obj fields are json string.I tried to convert that fields into json obt using Json.parser and then try to access.But nothing can display and wont give any error message. Json Obj [ { "jobId":"efe0ace0-8ed9-45ff-9232-974cbdc89b86", "jobType":"TestJob", "nextRun":"N/A", "lastRun":"2015-11-26 13:26:10.664", "createdDate":"2015-11-26 13:26:10.664", "executor":"g", "JobDetails":"{\

Angular UI Grid autocomplete with ui-grid-cellnav

好久不见. 提交于 2019-12-25 05:48:28
问题 I have an autocomplete in my ui grid its working fine but when put ui-grid-cellnav directive then keyboard up and down arrow is not working for autocomplete. <div class="grid nonProductiveTimeGrid" ui-grid="nonProductiveTimeGridOptions" ui-grid-resize-columns style="width: 100%;" ui-grid-edit ui-grid-cellnav ui-grid-auto-resize ui-grid-draggable-rows ui-grid-selection></div> and controller code for grid column is var _columnsDefs = function (isLocked) { var cols = [{ field: 'ResponsibleParty'

Angular js UI grid is not getting updated with new content

我是研究僧i 提交于 2019-12-25 03:58:27
问题 I am calling $http.get to get new content from the server for angular ui grid. On change of date in the datepicker I trigger an ng-change event to make another http call to get new content. The call is successful but the grid is not updated with new content.$scope.grid.core.notifyDataChange() throws error when called inside the http success call back.Please suggest ways to update the grid with new content. Please find the plnkr code. when I click load button, I want to update grid with new

Is there a way to display button in the angular ui-grid on mouseover on that particular row?

一笑奈何 提交于 2019-12-25 03:21:19
问题 I have buttons in my angularjs ui-grid.But, those must be displayed only on mouseover on that particular row.I tried many things with cell template.But, not successful in doing it. Any ideas will be appreciated. 回答1: you need to add a rowTemplate and have ng-mouseenter=" grid.appScope.rowHover(row) " in the template. So is mouseleave here is code: $scope.gridOptions.gridOptions: { rowTemplate: ' <div ng-repeat="col in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell"

Change style and/or conditional style of the selection button

北慕城南 提交于 2019-12-24 16:30:52
问题 I would like to ask you, it's any way to add custom style to the selection button (cell?) I need set for example red color for one cell, yellow color for another one cell. It's possible to remove check picture from this selection button and replace it to standard checkbox input? I mean this (original selection buttons): and I would like to change like this (expected selection buttons): 回答1: <style> .ui-grid-row > [ui-grid-row] .ui-grid-disable-selection { background-color: yellow; } .ui-grid

How to update the columnDef of an angular ui-grid column dynamically

旧城冷巷雨未停 提交于 2019-12-24 15:35:41
问题 So the issue I'm facing is I would like to update the field property of a columnDef definition to show a different value based on some configuration that's being passed into the directive. I have a dumbed down version in this plunk: http://plnkr.co/edit/gmjUcQsnIOpqWwkoYiI8?p=preview Clicking the button in that plunk should switch the emails from actual to pretend . It's looping over the columnDefs on scope and then altering the field to be email.pretend from email.actual . Do I need some