How can I create multiple modal dialogs by classname (basically the same dialogs but have a different code black attached).
One I launch a modal dialog I cannot reference the dialog anymore because jQuery will move it to the bottom of the document so something like..
$(this).find('.dialog').dialog('open');
Would not work anymore.
If I understand this question correctly, you have multiple dialogs that have the same class name and you want to be able to show them all at different times?
If this is the case then you can simply add a second class name to the class attribute which uniquely identifies the dialogs but maintains the first class giving you its look and feel.
class='dialog OpenFileDialog' and then maybe class='dialog SavePictureDialog''
So then in code you reference them by the second class name $(this).find('.OpenFileDialog').dialog('open');
Does this help?
Related
Question: How would one best implement non-modal dialog in IOS like this (image attached)? Allow ability to drag move map still and select (long press) another location, which then that detail is populated in the pop-up "non-modal" dialog. Dialog can have ability to "delete" / "add to favourites" etc.
To clarify:
I'm asking how to implement the dialogs in the image I have marked "Non Modal Popup"
so for the iPad/horizontal regular case, I'm highlighting the dialog would be associated with the ViewController on the right, so therefore in this case the user could still drag the map within VC2, but also access/use VC1 as well
Some notes re my pondering:
can UIViewController.present NOT be used here as it is modal? If it can be used what settings to get this working?
it not would you recommend using an (a) separate UIViewControllerto implement, and show it up using the manual means of adding a UIViewController, OR (b) is it better to just keep it as a UIView in this case? In either of these cases one would have to do any adaption programmatically?
I'm trying to make a simple list editor in Dart, with Polymer, but I have some problems.
I will start by showing a screenshot of what it will look like.
design of the app
The left drawer is filled dynamically at run-time (a rest api is used to get the items).
The items are "MLayers" and clicking the button should add the corresponding "Layer" to the right part of the app.
The thing is I can't find a way to do this! I tried to launch a customEvent when the button is clicked but the method responsible of adding the new layer need the layer name (and I can't find a way to add parameters to customEvents...).
What do you recommand?
The structure of the app is:
mainApp
_ Drawer
__ MLayer
__ Layer
I think the class responsible of adding Layers should be the Drawer (in fact it contain the drawer AND the content). The Layer constructor should use the name (or ID) of the MLayer to display corresponding properties (lets say the MLayer "Dense" has properties "name" and "size"; the Layer is in fact an instance, while the MLayer is the maquette).
Thanks for the read!
EDIT: as requested, here's the code
Ok, so I didn't find the right way to do it, so I simply broke encapsulation by adding a property "MLayerDrawer" to my "MLayer" object and calling its method...
I'm still open to suggestions because this clearly isn't the right way to do it, it just work but is really dirty.
I implemented simple application according of example simple login view. Where we have login-view and main-view. But now, how I can implement on main-view MenuBar where every Items when clicked open different views. And those views are under MenuBar in same place (center on the page under MenuBar, on sample) in main-view. I tried with additional navigator(which name can be subNavigator) in main-view but we must register navigator in UI(I have got appropriate error). Second solution is that I create UI and in init method ManuBar and under it change every views(login-view, view1, view2 etc). But login-view have ManuBar and it is do not looks good. Is there any other way or are other ways to achieve something similar?
Your question is not at all clear. I suggest re-writing it. Perhaps with a sketch image.
TabSheet
Are you aware of the TabSheet widget? An easy way to switch between panes of content.
See the Book Of Vaadin, the class doc, and the live demo.
Also, look at TabSheet in the Reindeer theme as shown in this demo.
I have the main UI class with a button that shows a subwindow when clicked. That subwindow has a textField and a button. When you press the subwindow's button, another sub window opens. You could call it the sub-sub window. This sub-sub window has a textfield and a button that will close this sub-sub window. I would like to update the textfield in the subwindow when i close this sub-sub window with the textfield value on the sub-sub window. is there a way to do this without creating everything on the main UI Class? I would like to create 2 classes for these sub windows and would like to pass the data back. I got it to work by putting everything on the main UI class but i thought there would be a better way.
TIA,
Thomas Kim
You can either bind all your components which acces shared data to same model, using Vaadin Data Binding or you can use Events to propagate value changes from subwindows to whichever component may be concerned.
Consider using Model View Presenter pattern to structure you view layer. There is a nice article to explain basics of MVP and its implementation in Vaadin.
https://vaadin.com/web/magi/home/-/blogs/model-view-presenter-pattern-with-vaadin
This approach will not only solve your problem, but also lead to better separated and maintable presentation layer.
I want to know in spine how to add and remove active class for div. In the firebug I saw initially 4 div inside, the first div having class as active when i click new link the div class active was removed for the first div at the same time the second div getting the class active. I don't have any idea how Spine add and removing class active.
By jquery we can do this. But i want to do this in spine (spine_rails)
Any idea?
Have a look at the Manager and Stack classes, I'm pretty sure that's what you're looking for. Stack has an internal Manager, which deals with keeping active state on only one controller at a time. It does that simply by adding the css class "active" to the currently active controller. From the docs:
A Stack doesn't alter the display CSS property of its controllers, but rather simply adds and removes an active class.
That explains what you're describing.
Not sure what you're looking for due to lack of information.
However, you can check spine stacks to see whether that's what you want.
http://spinejs.com/docs/stacks
To remove active class in spine_rails add following line to your spine:controller #el.removeClass('active')