ngtable

Custom filter with AngularJS ngTable

泪湿孤枕 提交于 2019-12-02 23:32:34
I'm trying to construct a table using ngTable, but with different custom filtering than described in the example from the ngTable page . I want filtering in place, but I don't want ngTable to render the filter selectors. I want to render them myself (above the table), and then reference them in my "getData()" method. The example referred to earlier doesn't explain how any of that machinery works. I have no idea exactly what needs to be specified in the "filter" property in each "td" element. I understand the basic syntax of the AngularJS $filter function, but I'm not clear on what ngTable is

How to render an ngTable without the pagination decorations?

狂风中的少年 提交于 2019-12-02 20:19:29
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? This was recently fixed ( https://github.com/esvit/ng-table/issues/6 ) This code should do it for you (copied from same git issue): $scope.tableParams = new ngTableParams({ count: items.length // hides pager },{ counts: [] // hides page

AngularJS ng-table fixed headers

拥有回忆 提交于 2019-12-02 16:44:45
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? 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; overflow-y: auto; display: block; width: 100%; table-layout: fixed; } .table-scroll tr { display: table;

Add item json in ANGULAR with pop-up

北战南征 提交于 2019-12-01 18:56:30
I'm doing a web app. I have a dynamic table . First, you choose a PRODUCT and then the LOT . The list of item in the select are taken by json. Now the problem is that I want to add the possibility to create new item to add in the <select> LOT . So, first I tried to add the field in the LOT column using the following codes: $scope.addLot = function(id,val,lotId) { // console.log(id); var inWhichProduct = id; var newArray = { "value": val, "id": lotId }; //console.log($scope.items) angular.forEach($scope.items,function(v,i){ if($scope.items[i].id == id ) { $scope.items[i].lots.push(newArray);

What is '$data' in ngtable's HTML page

这一生的挚爱 提交于 2019-12-01 15:18:46
I am using ngtable and at this place in HTML while displaying table <tr ng-repeat="row in $data"> I do not understand the use of $data, as '$' is not needed in other cases in ng-repeat. ng-table maintains it's own scope, and $data is the data which exists in this scope, rather than your full data set, which is on the scope of the page controller. It is the property that is populated by the getData() function call in the ngTableParams() object. This usage and syntax is deprecated, and has been replaced entirely in the current ng-table source, which is now written in TypeScript as of v2.0.0. 来源:

Loading JSON via AJAX with NgTable parameters

て烟熏妆下的殇ゞ 提交于 2019-12-01 03:32:20
I'm trying to use ngTables to sort and filter data using an AJAX call. Currently I am able to replicate the data with an ng-repeat, but none of my sorting functions apply. I referenced this example http://plnkr.co/edit/zuzcma?p=info and was able to get it to work using a mock.js file, but right now I'm using a file that I loaded onto my webserver and I can't seem to get it to work. I'm sure the answer is fairly simple and appreciate any help. I've attached my markup to show you what my controller and html file look like. Thank you all and let me know if you need anymore information! Here are

Get the length of list shown by ng-Show

北战南征 提交于 2019-12-01 01:23:10
I'm using Vraptor + Angular, and the question is simple. I hide some rows in my table with ng-show, but I want to take the count/length of the actual lines shown. Example: I have 10 records on $data. But when I use ng-show, it just shows 5 records. When I use $data.length, it returns 10, but I want it to return 5. Table: <table data-ng-table="$tableUsuario.params"> <tbody > <tr data-ng-repeat="usuario in $data | filter:search:strict" data-ng-show="usuario.ativo == filtroAtivo && (filtroPerfil == null || usuario.perfil == filtroPerfil )"> I'm a little confused on the question, but could you use

Loading JSON via AJAX with NgTable parameters

≯℡__Kan透↙ 提交于 2019-12-01 00:04:06
问题 I'm trying to use ngTables to sort and filter data using an AJAX call. Currently I am able to replicate the data with an ng-repeat, but none of my sorting functions apply. I referenced this example http://plnkr.co/edit/zuzcma?p=info and was able to get it to work using a mock.js file, but right now I'm using a file that I loaded onto my webserver and I can't seem to get it to work. I'm sure the answer is fairly simple and appreciate any help. I've attached my markup to show you what my

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

不羁岁月 提交于 2019-11-30 22:20:01
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/multiaddr?cors=true&active='+address; $scope.loading = true; $scope.clearTableData(); $http.get(url)

AngularJS ngTable filtering by Date

天涯浪子 提交于 2019-11-30 19:59:22
I'm trying to set up ngTable in my application, but it doesn't support filtering by Date, and I can't figure out how to implement it. I initially had the date in my data as a timestamp, which allowed me to sort the column properly due to the incremental nature of a timestamp, but obviously I can't type September and filter the data. // Example row data from data array { "index": 0, "id": "54587313ac91d561b246bf90", "user": "user3", "date": 1390054873445, "status": "in-progress" } I tried setting it to a string, but when you filter or sort it doesn't produce a asc/desc order instead it comes in