PDA

View Full Version : from extjs array grid store, call csv file and store?



newbie2
19 Aug 2013, 10:41 AM
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) into the array store.

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] ]
};
});

What should I do to solve it?
Thanks!

Gary Schlosberg
21 Aug 2013, 3:50 PM
Thanks for including your code. Are you saying that you want to be able to import from a CSV file into a grid?

newbie2
26 Sep 2013, 4:58 PM
Thanks for including your code. Are you saying that you want to be able to import from a CSV file into a grid?

Yes, exactly! Is there a way to do it for a big data grid?