Show new view in Ext.tab.Panel - sencha-touch-2

I have Ext.tab.Panel with few items. One item is login panel of type Ext.form.Panel.From controller I call Ext.Ajax.request to login. From callback method i would like to show new view(logged in). I mean on the same tab replace tab content login form view with new view (Ext.List/Ext.Panel)
Can someone guide me how to make it? I did't found correct functions in Ext.tab.Panel docs.
Thanks

setActiveItem method for TabPanel (http://docs.sencha.com/touch/2-0/#!/api/Ext.tab.Panel)

Related

View Controller trouble in Xcode

I just now figured out how to add a new view when you press a button. For example, in my storyboard, I am using a tabbed controller and in my first viewController i have a button in the top right corner on a navigation bar. and when i press that button, it directs to another view controller. I was wondering how I would be able to write the code for that view controller? I tried creating a new file > objective-c class, but I dont know how to link them together? any help?
If you've made that other controller in the storyboard, you just change the class of that controller to your new class that you made. You do this in the identity inspector.
Use navigation controller to navigate between your view's, You have to make an IBACTION method fot the button. In which you will navigate the view you want by pushviewcontroller.
Please see this link...
How to push viewcontroller ( view controller )?
It implies that which class has to be initialized and what is the nib name of this class. We should not do anything in this block, until you need that your code to be executed before viewDidLoad/viewWillAppear.
Turns out that there is no code necessary to get a button to direct you to another view controller that you set up. You have to declare the button obviously in the #interface part, connect the button with it's code, and then you have to use an action connection from the button to the next view controller you want the button to activate. I have used a modal connection personally, mainly because I'm not sure what a push connection is or what it does... But Ya I figured it out! Hope this helps to any other people who need this!

Master/Detail Application : Add a second Split View Controller to the Detail View

I have a MAster/Detail Application and everything is fine. Now when loaded, we have the Button Named "Master" That will slide over the original Master View Controller. I want to change it's behavior ,so instead of popping over the original MasterViewController..i need it to popOver another SplitViewController with the option of going back to the original one. Any ideas how to create this? I dunno where to start. Any ideas will be highly appreciated
Please Check This Edit
Edit 1 :
To be more precise...i have a dictionary application that first loads all the elements in the master view controller on the left...once i click on any element, it will open up in details view controller as it should.
Once in the Details view controller..if i click on Add to Favorites button...and click on the button Show Favorites...i need it to show me in the MasterViewControlle all the selected favorites instead of all the dictionary elements...how can i do it?
Seeing your question i feel you want to have UISplitViewController like below.
I never worked on it but try out this tutorial and try to integrate this feature in your project.
Raywenderlich tutorial link Click here
UISplitViewController class reference Click here
check this Question already asked in stackoverflow if you want to use protocol objectiveC protocol issue Detail -> Master communication.
You can use KVO as well.Check this Link : http://2pi.dk/tech/cocoa/kvo_dispatch.html

Apple Sample Code : Multiple Detail Views

I just downloaded the apple same code Multiple Detail Views.
http://developer.apple.com/library/ios/#samplecode/MultipleDetailViews/Introduction/Intro.html
I was playing around with it to try and figure out how it works, and so far I have only had one problem: when I create my own files/view, there Menu button is not present.
Default first view controller with Menu button
The drop down menu with the third view that I created
The third view that I created, that has no menu button
I poked around the interface builder and there are no buttons there for the default views. Then I found a method in the RootViewController that displays the button.
My problem is that I can't find where the first 2 views call that method to display that button.
Answering my own question here:
In the end, all you have to do is link the view, and the toolbar to the file's owner. You can view a tutorial on how to do that here (in part 3c)

NSButton: Action on Element within a Custom View

Sorry for the complicated title, but it's hard to explain.
This is the hierarchy I have:
Custom View
Custom View
Push Button
Box
WebView
WebView
The way my code works, is that the 'Box' has a 'setContentView' to one of the 2 WebViews shown above. So basically the Box can have a different WebView at any time.
I have the Push Button, which I want to assign to 'Go Back' on the WebView. But I need this button to 'Go Back' on the WebView which is within the Box.
So whenever the WebViews are switched around, the Push Button should link itself to whichever WebView is in the Box, and visaversa.
Is this even possible?
Thanks in advance everyone!
If you had an IBOutlet for your box (called theBox) defined in whichever custom view your button's action method is in, you can just use this in that action method:
[(WebView *)self.theBox.contentView goBack];
So whenever the WebViews are switched around, the Push Button should
link itself to whichever WebView is in the Box, and visa versa.
Why not use a more conventional arrangement? Make the view controller the button's target, and have the action in the view controller take whatever action is appropriate. In this case, that would be adding the appropriate web view to the box.
Views normally don't know anything about how the application works. They just do what the controller tells them to do.

TTWebController with drag refresh

i'm looking three20 and I wish make this thing: use a TTWebController but implement the feature that is shown on the 'Table with drag refresh', drag to the bottom and the webpage will be loaded, showing on the top the arrow like twitter, like many apps... it's possible to do this?
how can I do this?
thanks in advance
Pull to refresh is implemented as a Table View Delegate and the TTWebController is a simple controller with a uiwebview in it.
One way around it would be to create a new TableViewController with the TTTableViewDragRefreshDelegate as the table delegate. You would then create another cell with the web view.
A problem with that solution is that the web view has it's own scroll view and that will take precedence over the tableview scrollview. so you would actually need to make sure you drag the table and not the webview.
All in all I suggest you not do it :) and use a button for the refresh.