Extjs grid表格里的json数据 如何先不然他显示,通过触发某个事件 或按钮后然后在显示
Extjs grid表格里的json数据 怎么先不然他显示,通过触发某个事件 或按钮后然后在显示?
var form = new Ext.form.FormPanel({
renderTo:'file',
labelAlign: 'right',
labelWidth: 60,
frame:true,
autoWidth: true,
height:200,
fileUpload: true,
items: [{
xtype: 'textfield',
inputType: 'file',//文件类型
fieldLabel: '文件名',
name : 'uploadFileFieldPath',
id : 'uploadFileFieldPath',
allowBlank:false,
blankText: '请浏览图片'
}],
listeners : {
'render' : function(f) {
this.form.findField('uploadFileFieldPath').on('render', function() {
//change事件变化
Ext.get('uploadFileFieldPath').on('change',
function(field, newValue, oldValue) {
var filePath = Ext.getCmp('uploadFileFieldPath').getValue();
Ext.Ajax.request({
url: 'index.action',
method: 'post',
params: { filePath: filePath },
success: function () {
alert('成功');
},
failure: function () {
alert('失败');
}
});
}, this);
}, this);
}
},
});
var store = new Ext.data.JsonStore({
url: 'index.action', //返回json的文件
autoLoad: true,
fields: ['fileName', 'ipoName', 'uwCode'], //读取里面的属性
var form = new Ext.form.FormPanel({
renderTo:'file',
labelAlign: 'right',
labelWidth: 60,
frame:true,
autoWidth: true,
height:200,
fileUpload: true,
items: [{
xtype: 'textfield',
inputType: 'file',//文件类型
fieldLabel: '文件名',
name : 'uploadFileFieldPath',
id : 'uploadFileFieldPath',
allowBlank:false,
blankText: '请浏览图片'
}],
listeners : {
'render' : function(f) {
this.form.findField('uploadFileFieldPath').on('render', function() {
//change事件变化
Ext.get('uploadFileFieldPath').on('change',
function(field, newValue, oldValue) {
var filePath = Ext.getCmp('uploadFileFieldPath').getValue();
Ext.Ajax.request({
url: 'index.action',
method: 'post',
params: { filePath: filePath },
success: function () {
alert('成功');
},
failure: function () {
alert('失败');
}
});
}, this);
}, this);
}
},
});
var store = new Ext.data.JsonStore({
url: 'index.action', //返回json的文件
autoLoad: true,
fields: ['fileName', 'ipoName', 'uwCode'], //读取里面的属性