Results 1 to 2 of 2

Thread: Forcing windows to become draggable dynamically

  1. #1
    Ext JS Premium Member
    Join Date
    Jun 2010
    Posts
    75
    Vote Rating
    1
      0  

    Post Forcing windows to become draggable dynamically

    If you have the draggable config option in your window set to false but you want your window to become draggable later through an event listener then this is a possible solution.

    PHP Code:
    Ext.getCmp("cmpID").getEl().down(".x-window-header").setStyle("cursor""move");
    Ext.getCmp("cmpID").initDraggable(); 
    There is no direct method in the documentation to overide the window config (other than an actual override) but you can force the window to become draggable using the abstract method 'initDraggable()'. The only downside is you will have to style the header of that element to display the 'move' cursor.

    Anyway only a small suggestion but maybe someone will have or will be looking for something similar.

    Regards

    Nathan

  2. #2
    Sencha - Documentation Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,162
    Vote Rating
    257
      0  

    Default

    There's not an enable/disable dragging exactly. But, draggable: true sets up an instance of ComponentDragger:
    http://docs.sencha.com/extjs/4.2.0/#...mponentDragger

    ComponentDragger has a beforestart event that fires and I believe if you return false from the listener the drag operation will be cancelled.

    Window's draggable config doesn't allow you to pass in a config to be passed to the instance of ComponentDragger, but the instance is available as a property of the window as dd:
    http://docs.sencha.com/extjs/4.2.0/#...ow-property-dd

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •