Results 1 to 5 of 5

Thread: Excel data into grid

  1. #1
    Sencha User
    Join Date
    Sep 2017
    Posts
    20
    Answers
    3
    Vote Rating
    1
      0  

    Default Excel data into grid

    I was just wondering if there is a way to paste data from a excel table into a grid in extjs (sencha). Maybe with the ctrl + v option or a way to load the data from the excel too.
    Thanks guys.

  2. #2
    Ext Support Team
    Join Date
    Nov 2017
    Posts
    46
    Answers
    2
    Vote Rating
    -14
      -8  

    Default

    Hi,

    Not yet from the framework side of things. Maybe we can file this as a feature request.

  3. #3
    Sencha User
    Join Date
    Sep 2017
    Posts
    20
    Answers
    3
    Vote Rating
    1
      0  

    Default

    Quote Originally Posted by aravindballa View Post
    Hi,

    Not yet from the framework side of things. Maybe we can file this as a feature request.

    Thanks

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2011
    Posts
    49
    Answers
    3
    Vote Rating
    0
      -1  

    Default

    Hmm?, It is indeed built in, with one open issue... What about this ?
    Code:
    extend : 'Ext.grid.Panel',
    alias : 'widget.data_common_data_genericdatagridviewer',
    
    requires : [
        'Ext.grid.selection.SpreadsheetModel',
        'Ext.grid.plugin.Clipboard',
        
    ],
    
    controller : 'data_common_data_genericdatagrid_vc',
    viewModel : 'data_common_data_genericdatagrid_vm',
    
    bind : {
        selection: '{selectedRow}',
        columns : '{columns}',
        store : {
            // access the data portion from the current record displayed
    proxy : {
                type : 'memory'
    },
            data : '{current.data}'
    }
    },
    
    plugins: [{
        ptype: 'cellediting',
        clicksToEdit: 1
    },{
        ptype : 'clipboard',
    
        /**
         * TODO : remove this functionality if EXT-16236 is fixed
    */
    doPaste: function (format, data) {
            this.cmp.fireEvent('onPaste',data)
        },
    }],
    
    dockedItems : [{
        xtype :'toolbar',
        dock : 'top',
        items : [{
            text : /*i18n*/'Add row',
            handler : 'onAddRow'
    },{
            text : /*i18n*/'Remove row',
            handler : 'onRemoveRow'
    }]
    }],
    
    selModel : {
        type : 'spreadsheet',
        columnSelect : false,
        extensible : false, // by default this makes no sense for a viewer
    },
    
    emptyText : /*i18n*/'Paste data from the clipboard into the grid',
    columnLines : true,
    
    listeners : {
        afterrender : 'onAfterRender',
        // we take this to capture the paste events by CMD/STRG V
    onPaste : 'onPaste'
    }
    and in the controller's onPaste method :

    Code:
     onPaste(data){
         // do whatever you want with the data
    }

  5. #5
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,100
    Answers
    735
    Vote Rating
    969
      8  

    Default

    Yeah, this is absolutely supported, there's even an example of it in the kitchen sink:

    http://examples.sencha.com/extjs/6.5...ic#spreadsheet
    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.

Similar Threads

  1. Replies: 1
    Last Post: 17 May 2013, 4:44 AM
  2. Export Ext.Grid data in CSV (not Excel)
    By Sam007 in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 5 Nov 2012, 10:38 AM
  3. Pasting Data from Excel into the Grid
    By mdreeling in forum Ext: Discussion
    Replies: 1
    Last Post: 27 Mar 2012, 9:11 AM
  4. Export Grid Data into excel
    By Ajithamani in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 27 May 2010, 6:22 AM

Tags for this Thread

Posting Permissions

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