jQuery UI Widgets Forums Layouts Docking Add Windows and Create widgets dynamically

This topic contains 7 replies, has 2 voices, and was last updated by  Hristo 7 years, 4 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • Add Windows and Create widgets dynamically #96258

    dan123
    Participant

    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/

    Add Windows and Create widgets dynamically #96287

    Hristo
    Participant

    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 Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Add Windows and Create widgets dynamically #96302

    dan123
    Participant

    Hi 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/

    Add Windows and Create widgets dynamically #96319

    Hristo
    Participant

    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 Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Add Windows and Create widgets dynamically #96331

    dan123
    Participant

    Thank you. One problem I noticed when I close any of the windows, it will not let me dock these windows anymore.

    Add Windows and Create widgets dynamically #96345

    Hristo
    Participant

    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 Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Add Windows and Create widgets dynamically #96367

    dan123
    Participant

    Ok 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/

    Add Windows and Create widgets dynamically #96377

    Hristo
    Participant

    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 presumption addWindow is to add a new window and not to open and close it multiple times.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.