PDA

View Full Version : How to enable sorting function in grouping column



icliao
16 Jul 2012, 1:09 AM
Hi all,

I add some column in a grid, and the sorting function is work fine in the original situation.
But when I put some columns in a group, the function was disabled.

| Column................ A |................... |
|.--------------------------|.. Column B |
| Column1 | Column 2 | ...................|

ex. Column B can use default sorting function, but Column 1 and 2 can't.

Code is below, please guide how to enable the sorting function, thanks.
columns: [
{
xtype: 'gridcolumn',
width: 100,
weight: 80,
align: 'center',
dataIndex: 'ipType',
text: 'Product Type'
},
{
xtype: 'gridcolumn',
align: 'center',
dataIndex: 'ipPartner',
text: 'Provider'
},
{
xtype: 'templatecolumn',
tpl: [
'<a href="#" onclick="Ext.getCmp(\'hardQueryResult\').showWindow(\'{nineCom}\',\'{ipName}\');">{ipName}</a>'
],
align: 'center',
dataIndex: 'ipName',
text: 'IP Name<br>(Latest Version)'
},
{
xtype: 'gridcolumn',
dataIndex: 'ninePSA',
text: 'TSMC 9000 Quality Reference',
columns: [
{ //////////Can't sort
xtype: 'gridcolumn',
align: 'center',
dataIndex: 'ninePSA',
text: 'Pre-si Assessment'
},
{
xtype: 'gridcolumn',
tpl: [
'<a href="#" onclick="Ext.getCmp(\'gridview1\').showWindow(\'{nineCom}\',\'{ipName}\');">{nineCom}</a>'
],
align: 'center',
dataIndex: 'nineSiA',
text: 'Si Assessment (Version)'
},
{
xtype: 'gridcolumn',
align: 'center',
dataIndex: 'nineIPV',
text: 'IP Validation(Version)'
},
{
xtype: 'templatecolumn',
tpl: [
'<a href="#">{nineVP}</a>'
],
align: 'center',
dataIndex: 'nineVP',
text: 'Volume Production'
}
]
},

scottmartin
16 Jul 2012, 10:18 AM
You should be able to sort. I am able to sort price/change/% change:
http://localhost/extjs4/examples/grid/group-header-grid.html

Scott.

icliao
16 Jul 2012, 10:26 PM
Thanks for your guiding, I would check it again

icliao
16 Jul 2012, 10:41 PM
I used sencha designer Ver.2.0.0
And I check the group column sortable checkbox.
The code won't appear sortable : true , so the column can't be sort.
Is it a bug , and thanks for scott's guiding

scottmartin
17 Jul 2012, 7:08 AM
Architect(SA) simply generates the code, so if it does not sort, then SA is not generating the required code. Have compared your generated code with the example to see what is missing, or if SA is telling the columns not to sort .. as sorting is the default.

Scott.