Apr 26, 2012, 5:05 PM
[CLOSED] GridPanel created in Javascript. Reconfigure.
Hi!
I'm creating the gridPanel in Javascript, this way:
I'm trying use the grid.reconfigure(store, columns)....
columns, ok... but store don´t is 'replace' or reconfigured...
I'm creating then new store as follow:
But it would be very grateful if I pointed a way.
thanks for any help.
I'm creating the gridPanel in Javascript, this way:
var getGrid = function (title) {
return {
id: "panel1",
xtype: "panel",
flex: 1,
items: [{
store: {
model: Ext.define("SuperaWeb.SGCO.modelExplorerWebContext", {
extend: "Ext.data.Model",
fields: [{
name: "ID",
type: "int"
}, {
name: "Name",
type: "string"
}]
}),
storeId: "Store1",
type: "paging",
autoLoad: true,
pageSize: 10,
remoteSort: true,
proxy: {
data: [{
"ID": "1",
"Name": "Anderson Silva"
}, {
"ID": "1",
"Name": "José Aldo"
}, {
"ID": "1",
"Name": "Vitor Belfort"
}, {
"ID": "1",
"Name": "Lyoto Machida"
}, {
"ID": "1",
"Name": "Maurício Shogun Rua"
}],
type: 'pagingmemory'
}
},
id: "gridPanel1",
xtype: "grid",
flex: 1,
bbar: {
id: "tbPaging1",
xtype: "pagingtoolbar",
displayInfo: true,
store: "Store1"
},
columns: {
items: [{
dataIndex: "ID",
text: "ID"
}, {
dataIndex: "Name",
text: "Name"
}]
},
selModel: window.SuperaWeb.SGCO.rsmExplorerWebContext = Ext.create("Ext.selection.RowModel", {
proxyId: "rsmExplorerWebContext",
selType: "rowmodel"
})
}],
layout: "fit",
title: "Test of OnDirectClick!"
};
};
I wish reconfigure the grid with another data.I'm trying use the grid.reconfigure(store, columns)....
columns, ok... but store don´t is 'replace' or reconfigured...
I'm creating then new store as follow:
store = new Ext.data.Store({
model: Ext.define("SuperaWeb.SGCO.modelExplorerWebContext", {
extend: "Ext.data.Model",
fields: [{
name: "ID",
type: "int"
}, {
name: "Name",
type: "string"
},
, {
name: "Birthdate",
type: "date",
format: "M$"
}]
}),
storeId: "Store1",
type: "paging",
autoLoad: true,
pageSize: 10,
remoteSort: true,
proxy: {
data: [{
"ID": "10",
"Name": "xxxxxxxxxxx",
"04/12/1975"
}, {
"ID": "11",
"Name": "yyyyyyyyyyyyyy",
"04/12/1985"
}],
type: 'pagingmemory'
}
})
I understand that this support is not the responsibility of the staff of ext.net... But it would be very grateful if I pointed a way.
thanks for any help.
Last edited by Daniil; Apr 27, 2012 at 2:04 PM.
Reason: [CLOSED]