In my app I have a project controller and a tree view in my viewport. The treeview displays a list of projects. In the center of my viewport there is a tab panel. When I select I project in my tree view I want to open a specific tab for the current project. That works fine in my project controller.
To clean my code I want to extract this logic in a new ProjectDetails controller which is responsible for the tab opening and my Tabs form. What will be the right way to do that?
I would create a new controller and instead of opening the tab I would load this new controller, init it and launch it.
But how to put the project as param to the controller and in which method I should open my tab and assigning events to the components? I thought the init method is too early because the components aren't created...
Thanks and regards!
Related
I have a spa developed with AngularJS (routing with ngroute). Every template have the menu, in the menu there is a back button. I want to return to the previous view with he's state (information, scroll in the page etc). If I code every button in the menu to open the next template in modal that have dimension of full screen, and the back button just close the current modal. This method can do a memory leak?
This case is an hybrid application running in the tablet, the back button is in the menu of application not that of the browser.
Why don't you use $window.history.back();
Why don't you create a template for the menu and include it into your views by using ng-include?
I am working on an application in which we open all the views in a tabPanel, it was pretty simple to do that.
Now we got a new requirement where we have to open the view in Browser popup window so that it can be dragged to a secondary monitor. Ext.Window will not work.
we have a single page application and not sure how i can open a view in separate browser window.
i have tried the following, but then no JS events works on the new window:
var OpenWindow = window.open('', windowName, 'width=330,height=200,resizable=0');
OpenWindow.document.body.appendChild(divObj);//divObj is a div object in which i rendered the extjs view.
it open the popup but non of the style or js is working.
please help or point some example where it is accomplished.
Thanks in advance.
When opening a new window it doesn't have any information about ExtJS at all. you will need to include extjs into the new windows html. The best way to do this is to create a new popoup index file or page to be called. so say you are using routers properly in extjs say you have a site called http://testsite.com
Then you can in your window being opened create the elements in your current application to load when calling testsite.com/#popup then you just place it into your window.open. If you are managing your calls with something like PHP and using a framework for routing you can set it up the same way and have your javascript and extjs to be called from it as well.
var OpenWindow = window.open('http://testsite.com/#popup', windowName, 'width=330,height=200,resizable=0');
Reccomend creating a router like this: Extjs Routing Guide and from there have the component brought into focus on the page and placed that url into your popup if no backend system is used. Creating a new route in a backend link would be the best way to go, but you will still need to call your extjs applications components into your new page as well.
I am facing a problem in my EXTJS application.
Basically there is a grid which displays all the projects. In my main menu which is a different file, I have "Add Project" link. On clicking this, Add Project modal window opens irrespective of any main window which may be project list or dashboard currently displaying in browser.
Now I want if the main page is the Project List in the browser and I open the Add Project modal, When I will click Add button, I want the grid / store in the project list page should reload or refresh.
I am not getting any way to get a reference to the project store in the project list page from the Add Project modal window.
Can any one please help me on this.
Thanks in Advance... :)
You can use Ext.getStore('your_store_name'); to get a reference to your store.
The sencha grid tutorial covers this: http://docs-origin.sencha.com/extjs/4.2.2/#!/guide/grid
I'm converting a Flash/Flex application into an angular application.
In flash, I have a header, toolbar above, and navigation to the left. When users click on the navigation, different modules are loaded into the applications main content pane. Most modules support New, Edit, Archive, and Un-archive actions. There are icons in the toolbar that execute the actions.
But there are some modules that support additional actions. In flex, when the child module loads, it loads a new button into the toolbar along with a callback function that will be called when the user clicks on the custom action button. When the module unloads, it removes the button from the toolbar.
So in angular, what could I use to achieve similar functionality? Is this a parent/child scope kind of thing or something else altogether? I'm new to angular and I'm not sure how to approach this problem.
Thanks in advance.
i am developing a trigger.io application using backbone, the entire app is in one page but i need to open a detail page in a new window (not a modal view, a tab in android).
I don't know if it's possible to render a view in a new window, or write to history the view and navigate to the url.
Can anybody give me some tips.
Thanks
If you want to open a special view, specify a route calling this view.
Now you create a simple link with target blank to the route.
The application gets started in the new window and loads the action mapped to the route.
I think this is the best solution to do this, although there are ways to create windows and communicate between them in JavaScript. If you need to control the new tab, e.g. closing the tab or act on its content you are forced to create the new tab by javascript and keep a reference to the new tab.