Sencha Touch 2 NestedList goToNode() is not working - sencha-touch

I am invoking goToNode() like so:
nestedList.goToNode(Ext.create('myStore').getRoot());
The list shows the title in the toolbar correctly with no back button (so it seems like we're at the root), but the actual items in the list (the children) are not correct. They are leaves, and one is selected -- the last one I tapped.
I am navigating through a NestedList and end up at a detailCard. I transition to another view, and once I'm finished at that view, I want to go back to the NestedList at the very "top" of the list. I thought I could use goToNode() but it isn't working. How can I do this? It seems to me that goToNode is not working correctly.

Related

Swipe gestures with QML Stackview

So QML StackView provides a way to navigate back by usin the pop() function. I am looking for a way to go the previous page by simply swiping to the right with UI elements following the fingers of the user (kind of like a SwipeView). How can I achieve this? I have looked around and all I found was this https://github.com/alejoasotelo/SwipePageStackWindow which is an old project that does a similar thing with the old PageStack.
One possible way to do this is to create a custom element called swiper that has a swipeview with 3 pages. 1 and 3 are blank but 2 has content. When page 1 is active, it allows all events to pass through unless a left swipe is detected. Page 2 has a loader So you can change the contents.
If you create two of these on top of each other you can move the one in front of the other whenever you need to switch views. Two loaders means the content will never consume too much memory.
So you'll have a variable isBottomActive
And one method
function pushNewView(view) <- this will move whichever swiper is not active to the front, put the view into it's loader and change currentIndex to 2.
Now if you need to go backwards you just swipe to the right. The swipers view index changes (you can tie a method here to make the old swipeview move back to the bottom with a different view as well)

How to change view by clicking a listitem in Sencha Touch?

The following is the structure of my Sencha Touch Application. I have a view and I have given xtype "homepage" to it. In the homepage view I have the following items.
A toolbar docked at the top.
A list in the left side of the application
On the Right Side, I have a view with some display whose id is "display"
Problem: Now I want that when I click different options in the list, different views should be displayed on the right side of the homepage.
I am able to call list-item-tap function in controller and I am able to identify different items of the list. Only problem is that I am not able to replace the given display with another view
Okay, after searching a bit on the net, I found the following solution. I should use layout:'card' to the container in which I need to be changing views. In my case it is a container with id display.
Then in Controller.js I should write the following code:
var item = Ext.ComponentQuery.query("#display")[0];
item.setActiveItem({xtype:'xtype_of_your_view'});

Make an NSToolbar's fullScreenAccessoryView visible at launch

I am trying to make an application with a toolbar controller which view is shown, and for each view shown I want to include a second 'row' for the toolbar, and I found out that to do this you had to do [toolbar setFullScreenAccessoryView:view]. However, the view does not appear until the user toggles fullscreen mode and the accessory view remains after toggling the window back to windowed mode. I would like it to look like the following examples from Mail.app, Preview.app, Dictionary.app:
just place a custom view underneath the NSToolbarView .. so at the top of the window.
dont misuse the fullscreenAccessory view. it if meant for something else.
see How to create a toolbar with "Search" Finder style, rounded buttons working like radio
(it could be any other view too btw :D)

How do I properly move a scrollview when assigning a first responder?

I have a form in a UIView which consist of multiple textfields, couple of textviews and two fields that are interacted with by the means of an invisible button overlaid on them. When you click on a textfield, the keyboard pops up for text entry and I added a toolbar on it for navigating to the previous and next data entry (whatever the data entry is, be it a textfield, textview or one of the two special cases that are interacted with a button). Now, when I navigate with between textfields with those buttons everything works fine. My scrollview's content moves along the element that becomes the firstresponder (with the help of a piece of code from stackoverflow that scrolls the view while taking into account the height of the keyboard that hides a good portion of it). Here is a visual example.
The problem arises when I want to switch out of a specific data entry (date) that interacts with a hidden button. I'll give some context first. Those data entries show datepickers (one for the date, another for the time) in action sheets, and those action sheets also have navigating button in a toolbar, like so.
The code from stackoverflow that readjust the view do so in the didBeginEditing delegate methods of the textfields and textviews, so when I assign them first responder the scrollview adjust itself while taking into account the keyboard.
This means that, in the case that I switch into a special data entry, I manually move the scrollview's content so I can view the next element. When I switch from a special entry into a textfield I assume that the previously mentioned code from stackoverflow kicks in and adjust the view. It actually does when I move from the hour data entry (which uses a datepicker in an actionsheet) into the next element which is a textfield. However, when I'm at the date data entry (which is directly before the hour data entry) and press previous to assign the first responder to the textfield above it, the scrollview goes way ahead the text field, like so.
What's important to note is that this problem only occurs when the textfield is not in view. This makes me suspect that I'm incorrectly using the code that readjust the view. For instance, there is a constant in the code that represents the height of the keyboard. I tried changing it from 216 to 260 (so it takes into account my toolbar added on top of the keyboard) but this results in strange black artifacts near the buttom that only occasionally appears.
I'm kind of lost in this bug, and my post is already pretty long. I've prepared an example of my problem in a new project, if any of you could take a look into it I'd be very appreciative.
Here it is

Sencha Touch TabPanel fires show event on all children on load

I have a tabpanel with 4 lists as child items. When each list is shown I want to load it's data. When I launch the app all 4 show events fire even though only the first tab is active. Is this how it's supposed to be? I could use activeitemchange of the tabpanel to populate the lists but I want to keep the code separate for each list. It doesn't make sense having the tabpanel control it's child items.
There's another event call 'painted' which fires whenever a component as actually shown to the user. I don't know what the difference between 'show' and 'painted' is but this seems to fix my problem.