Page 15 of 15 FirstFirst ... 5131415
Results 141 to 146 of 146

Thread: [SOLVED]Grid Drag and Drop reorder rows

  1. #141
    Sencha User
    Join Date
    Mar 2011
    Posts
    22

    Default

    it's great extension, thanks all who contributed.

    can someone give try to add that fine-looking hover effect while hovering over the row while drag and drop? i've tried to add and remove class "x-grid3-row-over" to different places in plugin code, but even if was once close to desired effect, couldn't get to the final, perfect spot. there was always some drawbacks, like other row hovered also or js errors in console.

    greetz

  2. #142
    Sencha Premium Member
    Join Date
    Jun 2010
    Posts
    305

    Default

    Can anyone tell me how to apply this extension on single grid to reorder rows with drag n drop?

  3. #143
    Sencha Premium Member
    Join Date
    Jun 2010
    Posts
    305

    Default Drag and drop in singe grid using extjs 4.0

    Can anyone help me how to implement drag and drop in single grid

    Thanks

  4. #144
    Sencha User
    Join Date
    Nov 2009
    Posts
    16

    Default

    Does this still work in 4.2? I am having trouble implementing it.

    My guess is that getEditorParent() has become a private function since this was last touched, but I am kind a a neophyte to all of this, so I could be way off.

  5. #145
    Sencha User
    Join Date
    Jan 2014
    Location
    pittsburg , PA
    Posts
    32

    Default

    Hi i faced issue while running my code, this.do error.
    i got this error once the debugger is coming to renderTo: document.body line. where i made a mistake.
    Am using ExtJs 2.3 Version.

    Greetings !

    Code:
    Ext.QuickTips.init();
    
                var xg = Ext.grid;
    
                var reader = new Ext.data.Record.create({
                    fields: [
                         { name: 'seattype', type: 'string' },
                         { name: 'quantity', type: 'float' },
                         { name: 'mrc', type: 'float' },
                         { name: 'nrc', type: 'float' },
                         { name: 'extmrc', type: 'float' },
                         { name: 'extnrc', type: 'float' }
                    ]
    
                });
             // Ext.grid.GridView.c
                // define a custom summary function
                Ext.grid.GridSummary.Calculations['totalExtMrc'] = function(v, record, field) {
                    return v + (record.data.mrc * record.data.quantity);
                }
                Ext.grid.GridSummary.Calculations['totalExtNrc'] = function(v, record, field) {
                    return v + (record.data.nrc * record.data.quantity);
                }
    
                var summary = new Ext.grid.GridSummary();
    
                var grid = new xg.EditorGridPanel({
                    
    
                    columns: [
                         {
                             id: 'seattype',
                             header: "Seat Type",
                             width: 80,
                             sortable: true,
                             dataIndex: 'seattype',
                             summaryType: 'count',
                             hideable: false                         
                         },
                         {
                             header: "Quantity",
                             width: 20,
                             sortable: true,
                             dataIndex: 'quantity',
                             summaryType: 'sum',
                         //    renderer: function(v) {
                         //        return v + ' hours';
                         //    },
                             editor: new Ext.form.NumberField({
                                 allowBlank: false,
                                 allowNegative: false,
                                 style: 'text-align:left'
                             })
                         }, {
                             header: "MRC",
                             width: 20,
                             sortable: true,
                             renderer: Ext.util.Format.usMoney,
                             dataIndex: 'mrc',
                             summaryType: 'average'                         
                         }, {
                             header: "NRC",
                             width: 20,
                             sortable: true,
                             renderer: Ext.util.Format.usMoney,
                             dataIndex: 'nrc',
                             summaryType: 'average'
                         }, {
                             id: 'extmrc',
                             header: "EXT.MRC",
                             width: 20,
                             sortable: false,
                             groupable: false,
                             renderer: function(v, params, record) {
                                 return Ext.util.Format.usMoney(record.data.mrc * record.data.quantity);
                             },
                             dataIndex: 'extmrc',
                             summaryType: 'totalExtMrc',
                             summaryRenderer: Ext.util.Format.usMoney
                         }, {
                             id: 'extnrc',
                             header: "EXT.NRC",
                             width: 20,
                             sortable: false,
                             groupable: false,
                             renderer: function(v, params, record) {
                                 return Ext.util.Format.usMoney(record.data.nrc * record.data.quantity);
                             },
                             dataIndex: 'extnrc',
                             summaryType: 'totalExtNrc',
                             summaryRenderer: Ext.util.Format.usMoney
                         }
                    ],
    
                    view: new Ext.grid.GroupingView({
                        forceFit: true,
                        showGroupName: false,
                        enableNoGroups: false, // REQUIRED!
                        hideGroupedColumn: true
                    }),
    
                    plugins: summary,
    
                    frame: true,
                    width: 800,
                    height: 450,
                    clicksToEdit: 1,
                    collapsible: true,
                    animCollapse: false,
                    trackMouseOver: false,
                    //enableColumnMove: false,
                    title: 'Hosted VoIP GUI',
                //    iconCls: 'icon-grid',
                    renderTo: document.body
                });
          
    
            Ext.grid.dummyData = [
                        {seattype: 'Basic Seats', mrc: 17, nrc : 59},
                        { seattype: 'Conference Room Seats', mrc: 22, nrc: 59 },
                        { seattype: 'Standard Seats', mrc: 22, nrc: 59 },
                        { seattype: 'Premium Seats', mrc: 25, nrc: 59 },
                        { seattype: 'Receptionist Seats', mrc: 25, nrc: 59 },
                        { seattype: 'Hunt Group', mrc: 1, nrc: 4.95 },
                        { seattype: 'Auto Attendant', mrc: 10, nrc: 14.95 },
                        { seattype: 'Anywhere Number(s)', mrc: 10, nrc: 21.95 },
                        { seattype: 'Softphone', mrc: 49.95, nrc: 0.00 },
                        { seattype: 'Receptionist Software Console', mrc: 0, nrc: 49 },
                        { seattype: 'Voice Mail (TUI Only)', mrc: 0, nrc: 5.95 },
                        { seattype: 'Available TNs', mrc: 0, nrc: 4.95 }
                ] ;

  6. #146
    Sencha Premium Member
    Join Date
    Jul 2014
    Posts
    9

    Default Drag and Drop reorder and CheckboxSelectionModel

    Ext version 3.3
    Consider the following overrides:

    Code:
    Ext.grid.GridDragZone.override({
        handleMouseDown: function(e, t) {
            if(t.className == 'x-grid3-row-checker') {
                return false;
            }
            Ext.grid.GridDragZone.superclass.handleMouseDown.apply(this, arguments);
            return true;
        }
    });
    
    Ext.dd.DragSource.override({
        onBeforeDrag : function(data, e) {
            return (data.selections && data.selections.length > 0);
        }
    });
    Source: this post about grid drag and drop and CheckboxSelectionModel.


    One has to select the desired rows via the checkboxes and then drag and drop.

    Our CheckboxSelectionModel was with
    Code:
    checkOnly: true
    config.

    Thank you very much guys for your work and contributions to this extension !

Page 15 of 15 FirstFirst ... 5131415

Posting Permissions

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