[CLOSED] How to disallow grid drag drop if different groups are selected / disallow dropping in other group

  1. #1

    [CLOSED] How to disallow grid drag drop if different groups are selected / disallow dropping in other group

    Hello.

    I have a grid with a drag drop plugin that allows to reorder rows in order to change internal position values.
    This works fine so far but currently I'm stuck at two additional requirements caused by grouping.

    1. The user should not be able to drag rows if he has selected rows from different groups
    If it is not possible to block the dragging, at least the user should not be able to drop them anywhere

    2. The user should not be able to drop the record into a different group


    I have these problems because the grid itself is a valid drop element, therefore I can drag drop them among different groups.

    Any idea how I could solve that problem?
    Last edited by Daniil; Apr 11, 2013 at 3:24 PM. Reason: [CLOSED]
  2. #2
    Hi @blueworld,

    There should be some "beforedrag" (not sure about the name) which should allow to prevent dragging.

    I would search Ext JS API docs for "beforedrag".
    http://docs.sencha.com/ext-js/4-2

    Maybe, you will need to override some method of the Ext.view.DragZone class.
    http://docs.sencha.com/ext-js/4-2/#!....view.DragZone
  3. #3
    Hi Daniil,

    thank you.

    If I take an easy example, drop a record from group A into Group B.
    I know that I can get both records (the dragged one, and the one where I drop it before or after) as overModel and data.records[0]

    Is there a property that determines the current group of a record, like (if overModel.group.name != data.records[0].group.name) ..... ?
  4. #4
    There is the getRecordGroup method.
    http://docs.sencha.com/ext-js/4-2/#!...getRecordGroup

    Hope this helps.

Similar Threads

  1. [CLOSED] Selected rowindex is not updated after drag and drop in grid
    By profitsistemas in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Feb 07, 2013, 4:03 AM
  2. [CLOSED] Disallow Grid Refresh
    By adelaney in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 18, 2012, 5:04 PM
  3. [CLOSED] Drag and Drop with multiple Groups
    By mirwais in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 31, 2012, 2:50 PM
  4. [CLOSED] Removing drag target from drag group.
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 04, 2011, 8:41 PM
  5. [CLOSED] Determine parent exist (desktop) and disallow direct linking
    By CarWise in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 04, 2010, 3:00 PM

Tags for this Thread

Posting Permissions