Ionic New Slides - Swiper SlideTo bug - ionic-framework

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.

Related

Tab Key Stops Moving Between Input Fields

For the time being, this is a Material-UI question.
I have a situation where the tab key ceases to move the text cursor between TextFields. At the moment, I have no idea where in my code this is happening, and I am hoping someone can point me in the right direction so I can start looking.
Here’s the setup:
A mouse click causes a Dialog to be displayed. The Dialog has
several TextFields as well as 2 FlatButtons, “cancel & “submit”
At this state, tabbing between fields works as expected.
If I hit the “cancel” button, an event is fired which updates state (including the display of the Dialog) and the Dialog is closed. I can repeat the process from the top with no issues.
If I hit the “submit” button, an event is fired which does some async stuff (using rxjs epics).
On success, the epic fires an event which updates the state (including the display of the Dialog)
If I now try to repeat the process from the top, the tab key does not respond.
I am in the process of migrating to v1, and checked some of the v0.* components – they have the same problem – I don’t recall that being an issue before… Possible conflict between the two versions of the library?
Figured it out. Yes, there is a conflict between the v0.20 and v1.0 of the Dialog component. At least when you have one opening on top of another. Having changed all Dialogs to v1.0, the problem disappeared.
By the way, its not that the tab key wasn't responding - it was responding in the lower Dialog component and not in the top (latest to be created) one. This problem disappeared once the same version was used for both.

Ionic scrolling not work properly while adding dynamic item

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);

Predefined Add Dialog not working as expected in Lightswitch 2012

I've created a query to use in an AutoCompleteBox and it works as expected when the user select the AutoCompleteBox in the grid as shown in the picture below
However if the user click the plus button to add a new record using the predefined Add Dialog then the query and the AutoCompleteBox's format doesn't work as shown in the picture below
Why is this happening and how I can fix that?
Thanks
I haven't yet found a way to edit the default Add New dialog.
Instead, make a new screen, select the "New Data Screen" template, and link it to your entity data. You can customize the screen to fit your needs, even make it a Modal Window by changing the Control Type in the screen properties. Once you have the screen set up the way you want, go back to your grid screen, and double click on the Add... command in the Command Bar of your grid, to edit the AddAndEditNew_Execute code. In that method, call your custom screen.
So, as I got to thinking about this some more, I came back to the thought I had when I tried to do this a few months ago. There has to be a better way, so I Googled it again.
This time, I found something. He's using an old version of Lightswitch, but I've successfully applied his technique in my application built in Lightswitch 2012.
http://www.c-sharpcorner.com/UploadFile/051e29/modal-window-in-editable-grid-screen-in-lightswitch-2011/

Positioning ListViews in WinJS Metro apps using scrollIntoView

I am building a jscript-based Windows 8 Metro app. The main screen of this application is a scrolling "panorama" view with several list views showing various aspects of the app's state. In some cases the user will select something on the page which results in a navigation to another page (using the WinJS.Navigation.navigate method.
When the user hits the back arrow on the other page, it returns to the main screen, and I use "scrollIntoView" on to position the screen to the section that the user was working on before the navigation occurred.
Unfortunately this hardly ever results in correctly positioning the view. It seems random. I suspect that the page isn't finished being built yet and that the scroll values are set based on the state at some snapshot in time.
Now the question:
Is there some what to be notified by WinJS ListView objects that they are completely rendered and layed out? Or is this the job of the page's ready function?
Thanks for any insight!
Putting multiple list views side by side is Not A Good Idea(TM). I would recommend putting one list view, and placing your content in a grouped data source to get the groups. If the items have different templates, then you can use a custom item Template selector to dynamically select a template.
Additionally, to ensure that the list view is scrolled to the right position, you need to use the indexOfFirstVisible to set the items the name suggests.

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);