Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    2
    Vote Rating
    0
    newextuser2011 is on a distinguished road

      0  

    Default GridPanel Drag and Drop (el.dom based issue)

    GridPanel Drag and Drop (el.dom based issue)


    Hi,

    I am having trouble trying to do drag and drop (moving data from one GridPanel to another)

    I will pass full code if requested. However, It all works (JSON returning correctly and all that) -- The issue is when I want to include a drag/drop feature to a GridPanel. Here is an example provided from a Web page, which I used as a starter guide:-

    PHP Code:

    var moviesGridDropTargetEl =
    moviesGrid.getView().el.dom.childNodes[0].childNodes[1];
    var 
    moviesGridDropTarget = new
    Ext.dd.DropTarget(moviesGridDropTargetEl, {
    ddGroup'availableMoviesDDGroup',
    copytrue,
    notifyDrop: function(ddSourceedata) {
    function 
    addRow(recordindexallItems) {
    var 
    foundItem moviesStore.find('title',
    record.data.name);
    if (
    foundItem == -1) {
    moviesStore.add(record);
    moviesStore.sort('title''ASC');
    ddSource.grid.store.remove(record);
    }
    }
    Ext.each(ddSource.dragData.selectionsaddRow);
    return (
    true);
    }
    }); 
    moviesGrid.getView().el is null. Why? What could I be doing wrong?

    I have also tried other variations to this, such as .getView().mainBody and a few others and they not returning any relevant data.


    I will attach an example codeset. It is very simple stuff. It's just that particular line of code. What I am doing wrong?

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Posts
    2
    Vote Rating
    0
    newextuser2011 is on a distinguished road

      0  

    Default


    Basics of GridPanel
    PHP Code:
        var fields = [
            {
    name:'Id'mapping:'Id'},
            {
    name:'Code'mapping:'Code'},
            {
    name:'Name'mapping:'Name'}
        ];

        var 
    cols = [
            { 
    id 'Id'header"Identity"width160sortabletruedataIndex'Id'},
            {
    header"Code"width50sortabletruedataIndex'Code'}
        ];

        var 
    vp = new Ext.Viewport({
             ... 
    shortended code

                    xtype
    :"panel",
                    
    title:"Selection",
                    
    id:"selectionTab",
                    
    disabled:true,
                    
    items:[
                        new 
    Ext.grid.GridPanel({
                            
    id:"grdSelectionLeft",
                            
    ddGroup          'leftGridDDGroup',
                            
    store:{},
                            
    columns          cols,
                            
    enableDragDrop   true,
                            
    stripeRows       true,
                            
    title            'Services Available',
                            
    height:400,
                            
    width:400
                        
    }),

                        new 
    Ext.grid.GridPanel({
                            
    id:"grdSelectionRight",
                            
    ddGroup          'rightGridDDGroup',
                            
    store            : {},
                            
    columns          cols,
                            
    enableDragDrop   true,
                            
    stripeRows       true,
                            
    title            'Services Selected',
                            
    height:400,
                            
    width:400
                        
    })
                    ]
        }); 
    // End of Viewport

        /* NOTE ISSUE IS HERE */
        /*
            Also tried creating a GridPanel within a variable
            (ie var grdPanel1 = new Ext.grid...) so I have also
            done:-
                var ddrow = new Ext.dd.DropTarget(grdPanel1.getView().mainBody...
            Same applies to trying getView().el.dom, all of which return null/error
            More will be described after this code
        */
        
    var ddrow = new Ext.dd.DropTarget(Ext.getCmp("grdSelectionLeft").getView().mainBody, {
        
    ddGroup 'mygrid-dd',
        
    notifyDrop : function(ddedata){
            var 
    sm grid.getSelectionModel();
            var 
    rows sm.getSelections();
            var 
    cindex dd.getDragData(e).rowIndex;
            if (
    sm.hasSelection()) {
                for (
    0rows.lengthi++) {
                    
    store.remove(store.getById(rows[i].id));
                    
    store.insert(cindex,rows[i]);
                }
                
    sm.selectRecords(rows);
            }  
        } 
    Firstly, Yes, the code inside Ext.dd.DropTarget does not match the code I done above. This is not whats causing the error. The code was copied and pasted from another site. Basically, I added a break point to the area causing the problem and went through the available properties in Ext.getCmp("grdSelectionLeft") and Ext.getCmp("grdSelectionLeft").getView() and cannot for the life of me find the correct dataset required.

    So, I have tried getCmp, getDom, and (I think) getBody. Also, as mentioned in the comment, I also created the GridPanel into a variable. This follows the examples from other sites and from a book. However, the result is the same.

    just to demonstrate: -

    var grdPanel = new Ext.grid.GridPanel({...})

    I add it to my viewport (replacing the code above with it's var equiverlant)
    in the last portion, I use: -
    Ext.dd.DropTarget(grdPanel .getView().mainBody

    Result is the same.

    Could using the specific 'renderTo' property be the reason for all of this?
    I shall have to try this method and get back to you.

    Any questions, or suggestions, and I will reply as soon as I can.

    Many thanks.
    Last edited by newextuser2011; 7 Apr 2011 at 4:11 AM. Reason: some more info and tidied comment

Similar Threads

  1. Drag'n'drop with GridPanel in different Panel
    By Inoc in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 4 Mar 2011, 10:21 AM
  2. [SOLVED] Drag and Drop on GridPanel
    By rissato in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 13 Oct 2009, 6:52 AM
  3. drag'n'drop row in gridPanel
    By Radziu in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 10 Jan 2008, 1:29 AM
  4. GridPanel and drag&drop
    By wehtam in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 16 Oct 2007, 5:43 AM
  5. Grid Based Form Select (Drag and Drop)
    By vtswingkid in forum Community Discussion
    Replies: 2
    Last Post: 27 Aug 2007, 12:53 AM

Tags for this Thread