-
Ext JS Premium Member
ctp_sisqo:
I ended up reworking my grid and now everything seems to be working. Not sure if you are extending the grid or not, but maybe this will shed some light on the issue.
http://www.extjs.com/forum/showthread.php?t=49854
-Todd
-
Sencha User
The loadMask is ready when the gridView is ready. So put your store.load( ) in the event
GridPanel.viewready
It works well with me.
-
22 May 2013, 12:49 AM
#33
Sencha User
Thank you very much for sharing, viettp!
-
13 Jan 2014, 10:30 AM
#34
Sencha User
Hi
I create table using grid.panel. i put this code insude of function. but my window will not open. any clue ? what could i missed ? colors may differ the function. thanks for your help.
Main function
Var hvstore;
function hostedVoipQual() {
hvstore.load({ params: { cuid: userName } });
}
hvstore = new Ext.data.Store(
{
nocache: true,
reader: sereader,
autoLoad: false,
autoDestroy: true,
remoteSort: false,
proxy: new Ext.data.HttpProxy(
{
url: 'http://' + servers[1] + '/QVOWS/Se.asmx/getSe',
timeout: 9000000,
method: 'GET'
})
});
hvstore.on('load', function () {
hostedvoipstore.load();
});
hostedvoipstore.on('load', function () {
// I CREATE TABLE USING GRID PANEL HERE. BUT MY WINDOW IS NOT OPEN. ANY CLUE ? WHAT COULD I MISSED ?
var store = Ext.create('Ext.data.Store', {
fields: [
'HOSTEDVOIP',
{ name: 'quantity', type: 'int' },
{ name: 'MRC', type: 'int' },
{ name: 'NRC', type: 'int' },
{
name: 'total', type: 'int',
convert: function(val, record) {
var qty = (record.data.quantity > 0) ? record.data.quantity : 1;
return (qty * (record.data.MRC));
}
},
{
name: 'totalNrc', type: 'int',
convert: function(val, record) {
var qty2 = (record.data.quantity > 0) ? record.data.quantity : 1;
return (qty2 * (record.data.NRC));
}
}
],
data: {
'items': [
{
HOSTEDVOIP: 'Basic Seats',
quantity: 1,
MRC: 100,
NRC: 50
}, {
HOSTEDVOIP: 'Conference Room Seats',
quantity: 1,
MRC: 200,
NRC: 100
}, {
HOSTEDVOIP: 'Standard Seats',
quantity: 1,
MRC: 10,
NRC: 8
]
},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});
var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1,
listeners: {
edit: function(editor, e, eOpts) {
e.record.set('total'); // Ext.MRC field is calculated
e.record.set('totalNrc'); // Ext.NRC field is calculated
}
}
});
var editText = {
xtype: 'textfield'
};
var editNumb = {
xtype: 'numberfield',
minValue: 0
};
var grid = Ext.create('Ext.grid.Panel', {
width: 600,
height: 140,
renderTo: document.body,
store: store,
columns: [{
dataIndex: 'HOSTEDVOIP',
text: 'Seat Type',
summaryType: 'count',
summaryRenderer: function(value, summaryData, dataIndex) {
return Ext.String.format('TOTAL', value, value !== 1 ? '' : '');
}
}, {
dataIndex: 'quantity',
text: 'Quantity',
editor: editNumb
}, {
dataIndex: 'MRC',
text: 'MRC',
summaryType: 'sum'
}, {
dataIndex: 'NRC',
text: 'NRC',
summaryType: 'sum'
}, {
dataIndex: 'total',
text: 'EXT.MRC',
summaryType: 'sum'
}, {
dataIndex: 'totalNrc',
text: 'EXT.NRC',
summaryType: 'sum'
}],
features: [{
ftype: 'summary'
}],
plugins: [cellEditing],
});
// TABLE ENDED
});
Thanks,
Santhosh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules