jQuery UI Widgets › Forums › Layouts › Docking › Add Windows and Create widgets dynamically
Tagged: docking, javascript docking, jquery docking, jqwidgets docking, Knockout
This topic contains 7 replies, has 2 voices, and was last updated by Hristo 7 years, 4 months ago.
-
Author
-
Hi I have this docking with a button to “Add Windows” and after the add it creates a window and inside it has a dropdown to select a certain widget that can be added to this created window. I have been trying to figure this one out but I cant get the add window to work. I have already looked at the knockout example and not sure how to implement that in jquery.
Here is the knockout version: https://www.jqwidgets.com/using-jqxdocking-with-knockout/Here is my jsfiddle:
http://jsfiddle.net/YA9Kt/116/Hello dan123,
Could you clarify what you try to achieve?
You have a Knockout project or you try to get something from this kind of project?
I would like to suggest you use this example as a base to start and you could try to add your example there if you try to create a Knockout project.
After that, I will try to provide you a solution.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHi Hristo,
I decided to create a predefined set of windows cause they will be needing specific widgets inside these windows. I am having some problems where
1. Whenever I un-hide the window it will not dock. The window isn’t docking
2. I have this dropdownlist where it has the list of the window’s names, and a button to add the window in the docking area. I used the dropdownlist select event to find the label (Window name) and then once I click the button it will display that window. One problem I am facing is that it keeps displaying all the other windows too. So even if I didn’t select that window name, it will still show it. If that window exists already it will do nothing.Here is my updated jsfiddle:
http://jsfiddle.net/9qvwy42k/5/Hello dan123,
I would like to say it will be better to use ID selector when creating the widgets.
Also, it is not correct to bind to an event into another one.You could use
closeWindow
method of the jqxDocking.
Please, take a look at this example.
I would suggest you simply use .show() and .hide() methods to mimic this behavior to appeared different windows.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comThank you. One problem I noticed when I close any of the windows, it will not let me dock these windows anymore.
Hello dan123,
Could you clarify if the example below does not help you?
Please, take a look at this example: http://jsfiddle.net/kfjv3y39/Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comOk so basically what I mean is that. I call addWindow to show these windows and set their position as ‘docked’ and set a position like 0,1. But when I try to move these windows around to dock some where else, it wouldn’t do anything. It will just stay at the same position.
Test:
1. Pick Email from the dropdown, and click Add Window.
2. Try moving this window to a different spot, it wouldn’t let me set this window anymore. This is the problem I have. Not sure how to fix this.Here is my jsfiddle:
http://jsfiddle.net/kfjv3y39/3/Hello dan123,
I would suggest you try the approach that I mentioned in my previous post.
Please, take a look at this example.
In your example you use inappropriate approach – by presumptionaddWindow
is to add a new window and not to open and close it multiple times.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.