ngtable

ng-table not working for dynamic data

 ̄綄美尐妖づ 提交于 2019-12-17 14:09:10
问题 I have created a table and I am using http to load the data in the tables. So, in every click, my table data is changing, but I don't see the updated data in the table. I had created a sample Plunker for the reference. In my project, WHen I click on Reload New Data, the data in table get's changed, but after 2-3 click it doesn't change. DId anyone know, how to fix it.. 回答1: It is a problem with the ngTable directive. It updates only when data.length changes. Take a look at this plunk. I set

ng-table not working for dynamic data

三世轮回 提交于 2019-12-17 14:09:00
问题 I have created a table and I am using http to load the data in the tables. So, in every click, my table data is changing, but I don't see the updated data in the table. I had created a sample Plunker for the reference. In my project, WHen I click on Reload New Data, the data in table get's changed, but after 2-3 click it doesn't change. DId anyone know, how to fix it.. 回答1: It is a problem with the ngTable directive. It updates only when data.length changes. Take a look at this plunk. I set

Angular ng-table not loading dataset?

独自空忆成欢 提交于 2019-12-14 01:55:56
问题 I'm trying to use the ng-table directive. Having a really hard time just getting the demo code to work properly in my local project. http://ng-table.com In my controller, I set up my data. var dataset = [         {name: "Moroni50", age: 50},         {name: "Moroni49", age: 49},         {name: "Moroni48", age: 48},         {name: "Moroni47", age: 47},         {name: "Moroni46", age: 46},     ]; $scope.tableParams = new NgTableParams({}, {dataset: dataset}); When I console.log($scope

Losing ngtableparam scope in my View

不问归期 提交于 2019-12-13 17:43:11
问题 For some reason im losing scope of ngtable params in my view , everything in ngtableparams is undefined ( i see in angularjs batarang binding ). my controller code is this.contractsParams = new ngTableParams({ defaultSort: 'asc', counts: [], total: 10, // length of data getData: function ($defer, params) { this.MyService.query( angular.bind( function (data) { debugger; $defer.resolve(data.Data); })); } }); also , the getdata is not getting called at all ever. My View <table ng-table=

ng-table : filter on column

余生长醉 提交于 2019-12-13 07:14:09
问题 I am using ng-table and I want to filter my columns. It works with a simple data. <table ng-table="tableParams" show-filter="true" class="table table-striped table-bordered table-hover" id="dynamic-table"> <tr ng-repeat="consultant in $data"> <td class="text-center" data-title="'Ville résidence'" filter="{ 'villeResidence': 'text' }">{{consultant.villeResidence}}</td> <td class="text-center" data-title="'Contrat'" filter="{ 'typeContrat.contrat': 'text' }" > <span ng-repeat="typeContrat in

How can I put a placeholder text on ng-table select filter?

女生的网名这么多〃 提交于 2019-12-13 06:59:54
问题 Code sample: https://plnkr.co/edit/hdYjHtEx1Dto1q6UVCS9 $scope.idFilter = { id: { id: "number", placeholder: "Filter by id", // Working } }; $scope.nameFilter = { id: { id: "text", placeholder: "Filter by name", // Working } }; $scope.statusFilter = { status: { id: "select", placeholder: "Filter by status", // Not working } }; It is easy to add a placeholder on a number or text filters in ngTable. However I could not manage to find a solution for select filter. I know that placeholder on a

Selects droplist inside ngTable loses its scope

北战南征 提交于 2019-12-13 04:35:07
问题 If I put the Selects (select.js) droplist inside ngTable, and try to show the selection from outside the table, it loses its scope and doesn't show the selection. Hopefully, I was able to explain this. Here's the preview. In the preview, you will see a select droplist which has two output locations. One inside the table which works and another outside the table which doesn't. http://plnkr.co/edit/tQYmRrTjXOhTohsESpNo?p=preview 回答1: I solved your problem, and it had to do with levels of scope.

how to combine the customer header and filter in ngTable

霸气de小男生 提交于 2019-12-12 15:21:54
问题 I would like to create a ngTable that is the combination of the example of #4 (filter) and #18 (custom header) from the ngTable site. I can not get it to work. Can anyone show me an example? Thanks! 回答1: Since it really doesn't seem to work by just fusing the two examples, I have have created a new table for you based on example #18 of the ng-table site, see http://bazalt-cms.com/ng-table/example/18. First I have added a new input field with an ng-model in it so that the user-input that is

ng-table select filters show double blank items in IE

雨燕双飞 提交于 2019-12-12 04:37:29
问题 I am using an ng-table with select filters: <table ng-table="wrCtrl.waitingRoomTable" show-filter="true" cellspacing="0"> <tr ng-repeat="item in $data" ng-form name="form-data"> <td data-title="'Status'" filter="{importStatusDisplayText: 'select'}" filter-data="ctrl.importStatuses" sortable="'importStatusDisplayText'"> <span id="importStatus">{{::item.importStatusDisplayText}}</span> </td> </tr> </table> The source array ( importStatuses ) is: [ {id: 0, displayText: "Created"}, {id: 1,

Angular Table sorting does not work if i use a different api

前提是你 提交于 2019-12-12 04:31:57
问题 i took ngTable example from http://ng-table.com/#/loading/demo-external-array opened it in code pen and instead of "/data" i am using an api https://jsonplaceholder.typicode.com/posts and added isArray : true var Api = $resource("https://jsonplaceholder.typicode.com/posts", {}, { 'get': { method: 'GET', isArray: true} }); in html i took out all the columns and kept "id" column for simplicity it loads id column but searching sorting does not work. what is it that i am doing wrong ? changed pen