Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Tom McKearney
@tommck
Trying to make ui-scroll work well with some CSS we have. Our tables always take 100% width within their containers, so when we use the ui-scroll, it is throwing off all the TH tags' alignment with the TD tags. Anyone have a reasonable solution to this?
Denis Alexanov
@dhilt
@tommck I'm not a css guru, may be this issue could be solved via css, but it certainly could be solved programmatically. Just get th-widths on each digest cycle and force them as values of td-widths. To avoid forcing it for all td-blocks of all rows, you may inject some service tr-block and update only its td's.
Tom McKearney
@tommck
@dhilt - yeah, was trying to figure out the simplest option. Unfortunately a JS hack is probably it :(
Denis Alexanov
@dhilt
@tommck good luck!
Tom McKearney
@tommck
thanks :)
Tom McKearney
@tommck
@dhilt is there a way to know when the ui-scroll has filled the table with <tr>s?
I notice that the table is not filled when I'm trying to find the TDs at first
Tom McKearney
@tommck
it would be great if I could get a callback or event or somethign when the rows being displayed gets changed
Denis Alexanov
@dhilt
@tommck Try to subscribe on isLoading, and when it changes from true to false, you can be sure that after zero-$timeout the rows are rendered.
Tom McKearney
@tommck
I'll try that.. thanks
this is on the uiScroll directive?
Denis Alexanov
@dhilt
Yes
Tom McKearney
@tommck
ok, thanks. I'll figure out how to grab that from my code :)
Tom McKearney
@tommck
so.. I'm trying to encapsulate the header resizing and stuff in an "A" directive that goes on the table, so this might be difficult to do in a generic way
trying to make this resuable logic for other people on my team who tend to be less skilled
Denis Alexanov
@dhilt
https://github.com/dhilt/ui-scroll-grid -- this is my old exercise, it includes playing with tables and widths. I know, it is excessive and outdated, but it may be helpful in your case.
Tom McKearney
@tommck
:)
Tom McKearney
@tommck
If your dataset is externally controlled (maybe sorted or filtered), how do you trigger a reload of the data? YOu have to use a custom adapter at that point?
Tom McKearney
@tommck
oh.. figured it out, nevermind :)
Denis Alexanov
@dhilt
@tommck :+1:
Tom McKearney
@tommck
Is there a way to tell ui-scroll not to request negative index up front? it adds a lot of logic to the datasource get() to force the index + count to be correct in these situations.
I can't imagine too many situations where people actually WANT negative indexes
Tom McKearney
@tommck
2nd question: I don't see any mention of how to handle errors in data source get() calls. If the API I am calling times out or something.. how should we be handling this situation?
Tom McKearney
@tommck
So.. is there a better place to ask questions? :)
Denis Alexanov
@dhilt

@tommck Where is your data comming from? If it is some remote source, then the server side is responsible for indexes handling and the front end should not care about this. If you are using ui-scroll datasource.get as a data generator, then negative indexes handling is a part of your datasource logic. Anyway this logic should be implemented somewhere out of ui-scroll directive cause ui-scroll directive is not responsible for data generation and there is no option to tell the ui-scroll that the data will have no negative indexes at all. There may be a lot of ways how to implement it, e.g. https://github.com/angular-ui/ui-scroll/blob/master/demo/chat/chat.js.

Regarding error handling... Still the ui-scroll directive is not responsible for the data generation and the ui-scroll datasource.get is the only place for data retrieving, then I guess datasource.get should be used also for errors handling. And again, there's total freedom: in the example I just mentioned it may looked like Server.request(start, end).then(success).catch(errorHandler). So this falls to the ui-scroll user too.

Tom McKearney
@tommck
@dhilt I'm just pointing out that we're on computers and indexes to things rarely go negative. They also almost always start at zero. They start at zero in the language too. It just seems like a strange choice to default the first index to "1", when that's not even the default in the language it's written in
blackdebian
@blackdebian
hi, i working on ionic 3 project and i need try ui-scroll with it, but i don't know how import to my app angular modules, anyone can help ?
@PowerKiKi can you help me with this?
Denis Alexanov
@dhilt
@blackdebian I've played a bit with Ionic some time ago, look at the repo https://github.com/dhilt/ui-scroll-ionic
blackdebian
@blackdebian
thx
@dhilt i'm using angular 4 with lazy loading pages and components
Denis Alexanov
@dhilt
So, you may try https://github.com/rintoj/angular2-virtual-scroll or https://material.angularjs.org/latest/demo/virtualRepeat. The ui-scroll directive has no Angular2+ version.
blackdebian
@blackdebian
hum ok
thx :+1:
Pavan Thakur
@pavanthakur
Hello guyz, do we know which is best library to color scrollbar that works with ui-scroll. As when I try to use those library ui-scroll functionality is affected. Basically I want to consider coloring scrollbar for firefox as well, it will be good if any css dependent scroll bar is available. Any help\pointers will be very much appreciated. Thank you.
@dhilt have you worked on before
Denis Alexanov
@dhilt
@pavanthakur The ui-scroll library works with native scrollbar, so it should be possible to customize it in some way. But what's the way? If it uses javascript, then it needs not to be in conflict with ui-scroll javascript. This is a common thoughts, and each case should be considered separately. From our end, I have to say that we have no experience of ui-scroll scrollbar customization.
Pavan Thakur
@pavanthakur
ok thanks @dhilt for repl, I am searching for options. Thank you for the wonderful library, its great help.
Pavan Thakur
@pavanthakur
Basically I tried perfectscrollbar, slimscroll, nanoscroll, etc but my current functionality is not yet working as expected, hence thought to get head start from here. Thank you.
Tom McKearney
@tommck
what would cause the ui-router 0.4.2 to create a Controller for a page twice during a single navigation?
Tom McKearney
@tommck
oh.. just realized I have to "ui-view" divs nested.. I think that's causing it
Tom McKearney
@tommck
ugh.. no matter what I do, it's calling the Controller twice :(
Tom McKearney
@tommck
Nobody knows why a Controller would be called twice when OnEnter is only called once?
Denis Alexanov
@dhilt
@tommck I suggest you to write at https://gitter.im/angular-ui/ui-router
Tom McKearney
@tommck
oh jesus! lol
thought I was in there.. no wonder nobody responded!
thanks @dhilt