Results 1 to 4 of 4

Thread: Snap to grid positioning for a window

  1. #1
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    145

    Default Snap to grid positioning for a window

    Hi
    I've got a set of window that are constrained to a panel - and I can move them about without any issues.

    I can set

    resizable: {
    target: this,
    handles: 'all',
    dynamic: true,
    heightIncrement:50,
    widthIncrement: 50
    },

    on the window - and it will only resize in chunks of 50 pixels

    What I'd really like is to limit where the window can be dropped so it sits on that same 50x50 grid.

    I thought I could do it with something like

    draggable: {
    constrain: {
    snap: {
    x: me.snapToGrid,
    y: me.snapToGrid
    }
    }
    }

    but that doesn't seem to be available to a Window.
    I've tried various ways of doing it in the "move" event handler - but I'm having issues with the "Y" position (not relative to the panel maybe?)


    Any thoughts on how I can get the window to "snap" move as well as resize ?

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    145

    Default

    Does anyone at Sencha actually monitor these forums ?

  3. #3
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    145

    Default


    "Effective Jan 1, 2020"

Posting Permissions

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