Results 1 to 5 of 5

Thread: Grid Drag and Drop events

  1. #1
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default Grid Drag and Drop events

    I have just found that there are no DnD events (e.g. startdrag) in the current Ext version (1.0.1a).

    My question is: Jack, is there a plan to put them back in next version? Should I wait or should I find my solution?

    http://extjs.com/forum/showthread.php?t=5211


    Just to explain why I need it: I need to intercept startdrag event, among other reasons, because I want to change the DD ghost content from "xy selected rows" to the data from let's say first column of dragged row to show e.g. Company name.

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    Yes, we will be putting in the new DD events soon. For what you want though, there is a function "getDragDropText " you can implement. Here's what I am using in XTrack:

    Code:
    grid.getDragDropText = function(){
            var s = sm.getSelections();
            if(s.length == 1){
                return String.format('<b>Drag Ticket #{0} to your Watch List<b>', s[0].data.ticket);
            }else{
                var tickets = [];
                for(var i = 0, len = s.length; i < len; i++){
                    tickets.push('#' + s[i].data.ticket);
                }
                return String.format(
                        '<b>Drag the {0} selected tickets to your Watch List</b><br />{1}',
                        s.length, tickets.join(', '));
            }
        };
    Jack Slocum
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

  3. #3
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default

    Thanks Jack,

    that's valuable info so I'm not going to reinvent the wheel. Still a lot of work in another areas of my project...

    What about a rough roadmap what I (and maybe others too) am begging for?

  4. #4
    Ext User JasonMichael's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln Park, MI
    Posts
    132

    Default

    I can't seem to get scriptaculous to work well with extjs in the meantime... *sigh*. really just want to have a draggable div (no target droppable... just something real simple)........

  5. #5
    Ext User JasonMichael's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln Park, MI
    Posts
    132

    Default

    Nevermind, I figured it out. I was going down the path of darkness trying to get scriptaculous to work - I decided to save myself some agony and do this:

    PHP Code:
    var ddEl = new Ext.dd.DDProxy(Ext.get("specialbox") ); 
    One line of code above works great.

    So for those of you searching on drag and drop, or dragdrop, ext.dd, if all you want to do is something as simple as having a nice draggable object, use this code and save yourself some time.

Posting Permissions

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