Ionic scrolling not work properly while adding dynamic item - ionic-framework

am newbie to ionic. I try to add dynamic data to the top of my list, in this scenario ionic scroll doesn't work properly, other thing is newly added item ll not visible by default, to view new item , we need to scroll to up.I think we need to re-initiate ionic scrolling after new item added but i cant find out how to do. Any one have this trouble or found any solution for this problem. share with me in this post.
Is there any config settings available to re-initiate scroll after event occurs?

I don't fully understand your question, but if want to reinitialise scroll after dynamic data addition , you can use a work around like I do.
In your event, after data is added to your DOM. Call this.
$ionicScrollDelegate.scrollTo(0,$ionicScrollDelegate.getScrollPosition().top,true);

Related

Android - Show Back Button from XML

Before I begin, I want to mention that I've found a million answers showing how to do this from code, which involves setDisplayHomeAsUpEnabled(true) from your Activity. However, what I have not been able to find is a way how to do it from XML. (I would like to hide as much UI code in the XML files as possible).
One article I did find is this, which states
Step 3: Specifying the parent activity name in the AndroidManifest.xml adds the Back-Button arrow
and Click-action. Tapping on the back-arrow takes us to the Parent
Activity i.e Home Screen.
which doesn't work for me (the Back Button doesn't appear). I've followed all the steps in the article.
Does anyone know how to do this via xml? Is it even possible?
Yes, it's possible but still, you have to set the listener in java code. You can create a custom toolbar view and add a button to it. Then create a button in the java file and set the CilckListener.
Or You can use the default toolbar and do setDisplayHomeAsUpEnabled(true) from your Activity.
We usually make a custom toolbar, suppose you need a search bar in the toolbar then what you will do? So try to make an xml then use <include> tag in xml. You can search youtube. Follow the channel CodingInFlow, that guy explains very perfectly. If you don't understand what I am saying then understand the basics first, it will help you learn faster.

Ionic New Slides - Swiper SlideTo bug

I'm using the latest ionic 1 version 1.3.3.
I've a list of items. On click any of them, it opens the ion-slides with few left and right items (which I'm letting it to control dynamic). The issue is when the slider gets ready, it shows the correct index for the first or couple of time. But shows the first index afterwards when we come back to the list and click on another item.
I've used $scope.slider.slideTo to update the index. I also destroy slides instance before leaving but didn't get success.
Looks like it was not .slideTo() bug. But I think they should provide callbacks for the update methods.
Actually I've binded ng-hide on the slider for the loading.
So the slider was unable to render until the list is prepared. I was updating the index and then toggling the loading.
Resulting conflicts with update slide and index.
I placed style visibility: hidden with ngclass instead of ng-hide. It works perfect.

How to show a bootstrap modal from another component?

I'm building an app to manage some users, where i have a page to list them. On each user i have some buttons to make some actions on them, like edit them or delete them.
When the delete button is pressed, i would like to have a modal to show up and ask if you really wawnt to delete the user. As i may be using this modal in other places, i thought i should make it kind of generic to receive the different messages i want to show, so i built a component for it.
I've searched through some examples, but i couldn't find one similar to mine.
I've made the template for the modal and the component to back it up, but i don't know how to show it, for example, on a button click.
Any help is appretiated :)
Thanks
EDIT: i'm trying to use bootstrap modals
use bootbox instead of making a modal from scratch. they can be perfectly used for delete confirm or alerts. I use them. http://bootboxjs.com/. It is also available for angularjs.

Build some sort of workflow in JavaFX

I'm trying to build some sort of visual workflow in JavaFX. I want my application to have one main screen with the next and previous buttons, something like an installer. When a user clicks next, all the elements of the next screen appear in the same element. All previous choices of the user have to be saved. So when a user clicks on the previous button that all of his choices are still there.
How would I go on to do this?
I found these links on Google, but they don't seem to help me. Something like this is a bit the direction that I want to go, but the code in this tutorial isnt't really that good for scene's with a lot of elements.
The DataFX Framework provides a Flow API that can be used to define workflows. By doing so you can simply navigate between MVC Groups by only using annotations or configurations. You can find some examples of the API here:
http://www.guigarage.com/2014/06/datafx-tutorial-5/
http://www.guigarage.com/2015/02/quick-overview-datafx-mvc-flow-api/
http://www.guigarage.com/2015/01/datafx-tutorial-6/
I haven't worked with JavaFX in a while, but I'll start by saying I really hope you are using the JavaFX scene builder.
The way I would do it off the top of my head without going back and relearning JavaFX is to create a main window in the scene builder, and have a sort of central content display area, which holds another custom JavaFX container that contains the content you want to display, of which you can then create several of and swap out which one is being displayed programmatically.
Basically, create several smaller components representing each step or screen and display them programmatically in an owning container.

How to avoid CellList/Table from automatically scrolling to selected item when visible range is changed

I was implementing a custom CellTable that has a infinite scroll feature using the CellList showcase example ( http://gwt.google.com/samples/Showcase/Showcase.html#!CwCellList ). However, I found a feature in CellList/Table that is undesirable in this case: changing visible range after clicking an item would cause the List/Table to be automatically scrolled to the selected item.
you can try the showcase example in above to see the exact same behavior. When no item is selected, the infinite scroll works just fine, but when you click an item and then scroll it, it will always jump back to the selected item when the range is changed.
I also found that it only happens when the focus is still on the item, that is, if you select an item and then click somewhere else to lose the focus, it wouldn't happen.
I've been digging around the GWT code and trying to find out how to disable this feature with no success. Did anyone handled this situation before?
As a simple workaround, you can call focus() on some element, to remove the focus from the item (without removing the selection).
In the showcase example, in ShowMorePagerPanel, add e.g.
scrollable.getElement().focus();
at the beginning of the onScroll(ScrollEvent event) method.
I ran into the same problem and couldn't get Chris's answer to solve it, but the following solution worked for me:
in your onScroll(ScrollEvent event) method, add a line similar to the following, assuming yourTable is an instance of something extending AbstractHasData
yourTable.setFocus(false);