0
votes

I have my code to upload my EXTJS array grid. However in store, I don't know how to call my data from a csv file that I have just uploaded (without saving).

Here's my controller upload.js:

Ext.define('APPLICATION.controller.upload', 
{
  extend : 'Ext.app.Controller',

    init: function() 
    {
        this.control(
        {
            'uploadview button': 
            {
                uploaded: this.uploadedfile
            }
        });
    },

    uploadedfile : function(form)
    {
        console.log('uploadedfile called, file: ' + form);

        Ext.create('Ext.container.Viewport',
        {
            items:
            [
                { 
                    xtype: 'displayview',
                    store: form //guessing here ******
                }
            ]
        }
        );
    }
});

Here's my view display.js:

Ext.define('APPLICATION.view.display' ,
{
    alias : 'widget.displayview',
    var store = Ext.create('Ext.data.ArrayStore', 
    {
        fields: 
        [fieldData]
        /********data: myData*************/
    });
    var grid = Ext.create('Ext.form.Panel'),
    {
        //extend: 'Ext.form.Panel',
        //alias : 'widget.displayview',
        requires: 'Ext.grid.column.Action',
        xtype: 'array-grid',
        store: store,
        columnLines: true,
        height: 400,
        width: 800,
        title: 'Array Data Grid',
        viewConfig: 
        {
            stripeRows: true,
            enableTextSelection: true
        },
        columns:
        [columnLines]
    };
});
2
Can you describe your goal? What activities are you doing? Generally you get data from client (upload) and store it somewhere on server. Then you send data back to the client's grid (not a csv, but json e.g.).Peter Ivan

2 Answers

0
votes

Your display.js is not correct. See line after your alias.

0
votes

Maybe you are looking for FileReader - API