AngularJS ngTable delays rendering elements

286 views
Skip to first unread message

David Michael Pennington

unread,
Mar 16, 2014, 5:22:24 AM3/16/14
to ang...@googlegroups.com
I have a demo page (below) which I've been working on, and I'm stuck at one important point; when the page loads, the elements of the ngTable will not render until I type the first character in one of the filter boxes.  My demo page is here: http://demo.pennington.net/ (no index.html).

I posted the source code, as well as many more details here:
http://stackoverflow.com/q/22429534/667301

Can someone help work out why the table won't render until I type something in the filter field?  What should I do to fix this issue?

FYI, I know the project doesn't work in IE9; I'm not concerned about that part of the problem.

Thoughts?
\mike

Sander Elias

unread,
Mar 16, 2014, 7:29:22 AM3/16/14
to ang...@googlegroups.com
Hi David,

I browsed over your code. You should really build a plunk for these questions, that makes it a lot easier to help you.
what struct my eye was this:
 filter: {
                    Column01: "",
                    Column02: "",
                    Column03: "",
                }
You are here setting a filter for all columns of your data being empty!, did you try replacing "" with null?

Regards
Sander


David Michael Pennington

unread,
Mar 16, 2014, 7:41:49 AM3/16/14
to ang...@googlegroups.com
Hi Sander,

Thank you for your suggestion.  I tried this, but the table refused to display at all once I substituted null defaults:

                filter: {
                    Column01: null,
                    Column02: null,
                    Column03: null,
                }


I have a plunk (link below), but it refuses to render the table at all; it's probably user error on my part since I'm not used to building plunks.  I wound up removing it from the SO question because I noticed that people kept clicking that broken plunk instead of going to the demo webapp which works.


--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/r50jwoUKsfU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

David Michael Pennington

unread,
Mar 16, 2014, 7:45:18 AM3/16/14
to ang...@googlegroups.com
Apologies, my plunk link above is incorrect... this is the right one...

http://run.plnkr.co/plunks/fQuZOn/


On Sun, Mar 16, 2014 at 6:29 AM, Sander Elias <sande...@gmail.com> wrote:

David Michael Pennington

unread,
Mar 16, 2014, 4:20:30 PM3/16/14
to ang...@googlegroups.com
I managed to correct the problems with the plunker... it was a CORS problem (being a network engineer, that fact escaped me until a kind soul on SO pointed it out).

The functional plunker:
http://run.plnkr.co/plunks/fQuZOn/

Sander Elias

unread,
Mar 17, 2014, 12:16:02 AM3/17/14
to ang...@googlegroups.com
Hi David,

Had not much time to look,
But the problem is, that you are building the page, before your data has come back from the server. If you put the stuff in your getData inside a then off the data, it will work.
I will be back at the office tomorrow, if you didn't get it to fly, drop me a note, and I will fix it for you.

Regards
Sander

Sander Elias

unread,
Mar 17, 2014, 12:27:21 AM3/17/14
to ang...@googlegroups.com
Hi David,

had a spare couple of minutes: http://plnkr.co/edit/vDHZnl?p=preview

David Michael Pennington

unread,
Mar 17, 2014, 9:02:28 AM3/17/14
to ang...@googlegroups.com
That works, thank you!


On Sun, Mar 16, 2014 at 11:27 PM, Sander Elias <sande...@gmail.com> wrote:
Hi David,

had a spare couple of minutes: http://plnkr.co/edit/vDHZnl?p=preview

--
Reply all
Reply to author
Forward
0 new messages