angular-ui-grid

How to set row selection to newly added row?

风流意气都作罢 提交于 2019-12-12 16:29:03
问题 I need to set selection to a newly added row. When $scope.gridApi.selection.selectRow(newObject) is entered, the grid's row model does not have the new row and thus can not select it. After method addRow is finished, the grid shows the new row (and the data) but no selection was made. My test code: $scope.addRow = function() { $scope.gridOptions.data.unshift({ // my new data object }); var newObject = $scope.gridOptions.data[0]; $scope.gridApi.selection.selectRow(newObject); }; How can I

Updating Model in Angularjs

白昼怎懂夜的黑 提交于 2019-12-12 05:28:21
问题 Here is the plnkr : http://plnkr.co/edit/s9MwSbiZkbwBcPlHWMAq?p=preview If I add information twice, latest data are the same, how can I prevent model from updating? $scope.personList = []; $scope.newPerson = {}; $scope.columns = [{ field: 'Name' }, { field: 'Country' }]; $scope.gridOptions = { enableSorting: true, columnDefs: $scope.columns, onRegisterApi: function(gridApi) { $scope.gridApi = gridApi; } }; $scope.addPerson = function(){ $scope.personList.push($scope.newPerson); } $http.get(

AngularJS ui-grid export to pdf - Page number and Pdf title too left, but grid is too right

本小妞迷上赌 提交于 2019-12-12 05:10:01
问题 I am following this tutorial: http://ui-grid.info/docs/#/tutorial/206_exporting_data I am using angularjs ui grid. But when I export grid to pdf, UI is not look good. Problem: Page number and Pdf title is too left, but grid is too right I tried to search the solution online, but no luck. This is my grid options setting: gridOptions = { showGridFooter: true, showFooter: false, enableSorting: true, multiSelect: false, enableFiltering: true, enableRowSelection: true, enableSelectAll: false,

Celltemplate in angular-ui-grid is not working properly

一笑奈何 提交于 2019-12-12 04:35:03
问题 I am using UI-Grid to show data of attendance in my angular app.I have used i have three options for attendance stored in separate array. $scope.gridOptions.data.attendance=[{'persent'},{'absent'},{'leave'}]; and number of students are shown as: $scope.gridOptions.data=students;//from ajax request Now i want to show dropdown in attendance column as. I also want to show the persent as default selected option.so i used ng-options in celltemplate and code is like: $scope.gridOptions = {

Why am I not getting any values displayed in my ui-grid dropdown?

时光怂恿深爱的人放手 提交于 2019-12-12 03:47:51
问题 I have this following code for ui-grid column Definition: { name: "carrier_influence_group", displayName: "Carrier influence group", enableCellEdit: true, showSortMenu: false, editableCellTemplate: 'ui-grid/dropdownEditor', editDropDownOptionsArray: [ { id: 11, value: 'Medium' }, { id: 12, value: 'Large' }], editDropdownIdLabel: 'id',editDropdownValueLabel: 'name'} I am binding the name of these object to the column. Every thing is fine normally. The grid as such renders correctly. But when I

How to change the default text of UI-Grid menu option

旧城冷巷雨未停 提交于 2019-12-12 03:25:14
问题 I'm using UI-Grid framework to show tabular data with server side pagination and the grid menu turned on. On my "exportAllDataFn" I'm making an Ajax call to the server to pull that data, but I'm limiting the number of rows exported to a few thousand since the data set large enough to crash the browser if "all" data is exported. I want to change the default text of the menu option from "Export all data as CSV" to semething more indicative of what's happening, maybe "Export all data (max 2500

Getting angular ui grid scroll event

旧时模样 提交于 2019-12-12 03:21:52
问题 I am trying to register to the scroll event (get notified when new rows appear) like this: $scope.$on('ngGridEventRows', function (event, rows) { console.log("Scroll") }); But it does not fire.. (angular ui-grid version: v3.0.6) What would be the correct way to achieve it? 回答1: Im not sure about their native events, but you could create your own watcher for their scrolling-event. In this Plunkr I made a watcher that broadcasts on scroll. $scope.gridOptions.onRegisterApi = function(gridApi){

UI Grid get sorted items with pagination

僤鯓⒐⒋嵵緔 提交于 2019-12-12 02:44:06
问题 I have checked all stackoverflow posts related to ui-grid sorted rows without any success so I am opening one more question. SHORT : Need a way to get sorted rows following current sorting criteria. My problem is that I have an instance of UI Grid with pagination and I can not get the sorted data after it was added using a $mdDialog modal. It is shown at the right position in the tabel, but behind, in all objects it is stored the new element is on the last position. I call the ui-grid

Focus by default in filter header angular ui grid

青春壹個敷衍的年華 提交于 2019-12-12 01:37:45
问题 I have gone through the documentation forward and back and I cannot seem to find a way to give the header filter for one of the columns focus when it loads. The user typically filters on the same column every single time. I use these grids for line of business applications and every click or 'tab' saved is 500 saved per person per day. this.gridOptions.columnDefs = [ { field: 'Order' }, { field: 'Qty.' } ]; Then I have the following for the html, so Order gets a filter, but it is not focused

AngularJS ui-grid data value and display value

半腔热情 提交于 2019-12-11 20:22:41
问题 I am looking at using the AngularUI team's new table / grid implementation ui-grid. It looks really great, promising and easy to use. Tho I have a question / problem I can't find the answer to in the documentation. I want a column to sort on a different value then the one displayed, how can I achieve that? I have a rank property ranging from 1 to 10 which I want to sort on but I have a rank_name property I want to be displayed. The rank property would be the data value and the rank_name would