ngtable

Update bootstrap angularjs table with real time data on the fly using ng-repeat

余生颓废 提交于 2019-12-04 19:59:37
i am using bootstrap table with ng-repeat to populate the table. the issue is that i cannot get the table updated and display data. i have written drag and drop element in my angularjs. once i drag and drop some file over it i get that information back in my controller. this drag and drop is a custom directive. the problem is that i am getting the file detail in my controller $scope.getFiles = function(res) { $scope.fileList = res; console.log(res); } In HTML <file-drop fetch-files="getFiles"></file-drop> where getFiles is the function getting called in the controller and returing the value

ng-table pagenation not update after delete or add new record in the data item

好久不见. 提交于 2019-12-04 19:03:23
I am using np table in angular for data binding . ng table show paging and total number of record but when I add new row or remove one row from data model in ng table. Total row is reflected but total number of record and paging not reflected. I have used bleow code Any one can help me.. $scope.viewDeleteTemplateModel = function (templateId, name) { if (parseInt(templateId, 10) <= 0) { $scope.bindPopUpMessages(Enum.AlertType.Error, "TemplateId must be greater than zero.");//showing smart popup alert } else { $scope.bindSmartAlert("<i class='fa fa-fw fa-reorder'></i> Template", "Do you really

sorting feature in ngTable using Jasmine Testing

纵饮孤独 提交于 2019-12-04 17:47:46
I have created an application using ng-table , the application is working fine but i don'nt know how to write a test case for that sorting and getData. Can anyone please tell me some solution for testing that functionality My code is as given below jasmine test case describe('Testing Controllers', function() { describe('Testing WorkController Controller', function() { var WorkController, $scope; beforeEach(module('wsd')); beforeEach(inject(function($controller, $rootScope) { $scope = $rootScope.$new(); WorkController = $controller('WorkController', { $rootScope: $rootScope, $scope: $scope,

ng-table sorting not working

只谈情不闲聊 提交于 2019-12-04 04:58:49
I have created an application using ng-table, the application is working fine which had generated table using ng-table. The problem which i am facing is that the table sorting is not working. My code is as given below Working Demo html <table ng-table="tableParams" class="table"> <tr ng-repeat="user in myValues"> <td data-title="'Name'" sortable="'name'"> {{user.name}} </td> <td data-title="'Age'" sortable="'age'"> {{user.age}} </td> </tr> </table> script var app = angular.module('main', ['ngTable']). controller('DemoCtrl', function($scope, $filter, ngTableParams) { $scope.myValues = [{name:

In ngTables, running $scope.tableParams.reload() for the third time results in TypeError: Cannot set property '$data' of null

时光总嘲笑我的痴心妄想 提交于 2019-12-03 21:17:58
问题 This error is in regards to the ngTable plugin for AngularJS. I seem to be having a really weird error. Basically, I can run $scope.tableParams.reload() twice with no problem, but on the third execution, and every following one, I get the following error: TypeError: Cannot set property '$data' of null at [removed]/ng-table.js:411:55 I believe this is all the relevant code, but if anything is missing let me know: $scope.lookupAddress = function(address){ var url = 'https://blockchain.info

ng-table grouping - initialize with rows minimised

↘锁芯ラ 提交于 2019-12-03 16:06:34
I am using the grouping example of ng-table from http://plnkr.co/edit/CBcbkc Right now the table is initialised with rows expanded, but I would like them to be minimised as I have over 100 records. How can I do this? You can set group.$hideRows to true using ngInit : <tbody ng-repeat="group in $groups" ng-init="group.$hideRows = true"> Update I wanted to find a better solution, because the angular docs discourage using ngInit to access scope variables. You can create a controller for each group created in the ng-repeat : <tbody ng-repeat="group in $groups" ng-controller="groupCtrl"> Then, you

ngtable server side pagination

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hello I try figure out how make server side pagination with angularjs an ngtable. I have two web services: localhost:8080/app/api/period Method GET return json list of entities. As parameters are passed page number, range of start period and range when it stop. localhost:8080/app/api/period/count Method GET return count of periods. As parameters are passed range of start period and range when it stop. this.tableParams = new ngTableParams({ page: 1, count: 10 }, { counts: [10], total: 0, getData: function($defer, params) { $http.get('/app/api

How to render an ngTable without the pagination decorations?

北战南征 提交于 2019-12-03 06:40:36
问题 In my small AngularJS app, I render several tables using the ngTable library. Only one could use pagination. The others will always fit on less than a page. Every rendered ngTable seems to add the "10 25 50 100" selector below the table. For most of my tables, this is wasted space and is nonfunctional. How can I remove that section and get that space back? 回答1: This was recently fixed (https://github.com/esvit/ng-table/issues/6) This code should do it for you (copied from same git issue):

AngularJS ng-table fixed headers

被刻印的时光 ゝ 提交于 2019-12-03 03:13:55
问题 I'm using ng-table to display some information. I would like to make the header and footer of the ng-table fixed and force the ng-table to draw scroll bars within the rows. The ng-table documentation site has no documentation on how to make that happen. Any ideas? 回答1: this CSS-only solution worked for me. Just add the class table-scroll to the table element and the following CSS: .table-scroll thead { display: table; width: 100%; table-layout: fixed; } .table-scroll tbody { max-height: 150px

ngtable : sort and filter on nested object

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a list of objects to display on a table with ngTable. My object looks like : obj {label:string, nestObj{nestLabel:string } } In my controller I want to allow sorting and filtering on fields 'label' and 'nestObject.label'. I have tried this: $scope.tableParams = new ngTableParams({ page: 1, // show first page count: 10, filter: { label='', nestObj.label='' }, sorting: { label: 'asc', nestObj.label: 'asc' } }, { total: data.length, // length of data getData: function($defer, params) { // use build-in angular filter var filteredData =