ng-table icon indicating copy to clipboard operation
ng-table copied to clipboard

Initiliazing Filter tables with async data

Open HelgeWieding opened this issue 12 years ago • 11 comments

Hi

When i init the table with custom filter like this example => http://bazalt-cms.com/ng-table/example/11 inside a rest api call i get the following error: Error: Function names($column) must be instance of $q.defer()

when immediatly init the table then the data that the dropdown filter should show hasnt loaded yet and it also doesnt update.

Thx for your concern

HelgeWieding avatar Feb 19 '14 11:02 HelgeWieding

Did you ever figure this out? I am encountering the same error message

apoku avatar May 27 '14 14:05 apoku

Same issue here.

sathify avatar Jun 03 '14 18:06 sathify

Seems to be a problem for me too. I'm trying to introduce my own filter ajax function, due to a humongous dataset of filters

etodanik avatar Jun 10 '14 03:06 etodanik

The following pull request fixes this issue: https://github.com/esvit/ng-table/pull/342

etodanik avatar Jun 10 '14 04:06 etodanik

I am new to github. Is there a way to fork the original repo and then merge your pull request with it so I can have the fix?

realityfluxstudios avatar Sep 05 '14 21:09 realityfluxstudios

Look up how to apply a patch. You can use this pull request URL as a patch URL on your repo.

On Saturday, September 6, 2014, realityfluxstudios [email protected] wrote:

I am new to github. Is there a way to fork the original repo and then merge your pull request with it so I can have the fix?

— Reply to this email directly or view it on GitHub https://github.com/esvit/ng-table/issues/215#issuecomment-54684269.

etodanik avatar Sep 06 '14 16:09 etodanik

This patch #323 doesn't help.

When immediatly init the table then the data that the dropdown filter should show hasnt loaded yet and it also doesnt update.

When load all data and then init table — filter function called first (before loading) and return empty array

Seigiard avatar Jan 19 '15 17:01 Seigiard

What does patch #323 have to do with this thread? :)

Patch #342 addresses the issue, but it might be outdated since there seem to now be merge issues with the current version of ng-table. Test it out with the version that was relevant when I first posted it, and I can adjust it to the current version.

It's currently working beautifully in production on a project.

etodanik avatar Jan 19 '15 17:01 etodanik

Sorry, wrong number. Of course, we talk about #342

I created example to show my problem http://plnkr.co/edit/XJo9rp

So... how in index.js:5 in $scope.ages can I get data from index.js:19 Api.get(params.url(), function(data)?

Maybe my logic is wrong, then show me right way.

Thank a lot!

Seigiard avatar Jan 19 '15 17:01 Seigiard

Create a plunkr example for our problem.

Seigiard avatar Jan 19 '15 17:01 Seigiard

http://plnkr.co/edit/XJo9rp?p=preview — SOLUTION

Found solution for my question. Unfortunately, need to create two similar requests, when getting data for table and filter.

But it works.

Seigiard avatar Jan 20 '15 09:01 Seigiard