PDA

View Full Version : Grid Sum error



surjikoff
27 Jul 2012, 1:18 PM
Hello. I have Sum error in my grid. Count - work, min, max - work. But sum show this..
37569
my code:

var vypiskigrid = Ext.create('Ext.grid.Panel', {
viewconfig: {
loadMask: false
},
layout: 'fit',
border: false,
features: [{
ftype: 'summary'
}],

columns: [{
header: '? ?.?.',
width: 45,
sortable: true,
dataIndex: 'step_id',
summaryType: 'count',
field: {
xtype: 'textfield',
disabled: true

}
},{
xtype: 'datecolumn',
header: '????',
width: 150,
sortable: true,
dataIndex: 'date_from',
format: 'd/m/Y',
minValue: '00/00/0000',
editor: {
xtype: 'datefield',
allowBlank: false,
format: 'd/m/Y',
minValue: '00/00/0000',
}
},{
header: '??????????',
width: 150,
sortable: true,
dataIndex: 'content',
field: {
xtype: 'textfield'
},
},{
header: '????? ??????',
width: 100,
sortable: true,
dataIndex: 'number_zakaz',
summaryType: 'count',
field: {
xtype: 'textfield'
}
},{
header: '????? ??????',
width: 100,
sortable: true,
dataIndex: 'summa_oplaty',
summaryType: 'max',
field: {
xtype: 'numberfield',

}
},{
header: '????? ??????',
width: 150,
sortable: true,
dataIndex: 'summa_zakaza',
summaryType: 'sum',
field: {
xtype: 'numberfield',
},
}],

scottmartin
27 Jul 2012, 1:23 PM
We are going to need a working example with data for use to proceed with this. It looks like it is treating it like a string instead of numeric. Perhaps check your field type and values.

Scott.

surjikoff
27 Jul 2012, 1:48 PM
There all 37571

scottmartin
27 Jul 2012, 2:15 PM
As mentioned, changing your values to numeric allows for sum to work:



{
"total": "10",
"data": [
{
"step_id": 1,
"date_from": "2012-07-26",
"content": "?????",
"number_zakaz": 1,
"summa_oplaty": 345,
"summa_zakaza": 1,
"manager": "Smith",
"comments": "???????"
},
{
"step_id": 2,
"date_from": "2012-07-26",
"content": "?????",
"number_zakaz": 2,
"summa_oplaty": 0,
"summa_zakaza": 0,
"manager": "Smith",
"comments": "???????"
},
{
"step_id": 12,
"date_from": "2012-07-26",
"content": "?????",
"number_zakaz": 3,
"summa_oplaty": 5554,
"summa_zakaza": 3,
"manager": "Smith",
"comments": "???????"
},
{
"step_id": 14,
"date_from": "2012-07-26",
"content": "?????",
"number_zakaz": 4,
"summa_oplaty": 456,
"summa_zakaza": 4,
"manager": "Smith",
"comments": "???????"
},
{
"step_id": 15,
"date_from": "2012-07-26",
"content": "?????",
"number_zakaz": 0,
"summa_oplaty": 5,
"summa_zakaza": 0,
"manager": "Smith",
"comments": "???????"
},
{
"step_id": 16,
"date_from": "2012-07-26",
"content": "?????",
"number_zakaz": 6,
"summa_oplaty": 66786,
"summa_zakaza": 6,
"manager": "Smith",
"comments": "???????"
},
{
"step_id": 17,
"date_from": "2012-07-26",
"content": "?????",
"number_zakaz": 7,
"summa_oplaty": 45646,
"summa_zakaza": 7,
"manager": "Smith",
"comments": "???????"
},
{
"step_id": 18,
"date_from": "2012-07-26",
"content": "?????",
"number_zakaz": 0,
"summa_oplaty": 0,
"summa_zakaza": 0,
"manager": "Smith",
"comments": "???????"
},
{
"step_id": 19,
"date_from": "2012-07-26",
"content": "?????",
"number_zakaz": 0,
"summa_oplaty": 0,
"summa_zakaza": 0,
"manager": "Smith",
"comments": "???????"
},
{
"step_id": 20,
"date_from": "2012-07-26",
"content": "?????",
"number_zakaz": 0,
"summa_oplaty": 0,
"summa_zakaza": 0,
"manager": "Smith",
"comments": "???????"
},


]
}


37572

Scott