PDA

View Full Version : How to disable sorting rows (properties) in Ext.grid.property.Grid



e.taranov
27 May 2011, 9:28 AM
How to disable sorting rows (properties) in Ext.grid.property.Grid?
I don't need them to be sorted alfabetically.

montipirlo21
6 Jun 2011, 4:39 AM
sortableColumns : Boolean
Defaults to true. Set to false to disable column sorting via clicking the header and via the Sorting menu items.

Or you have to set sortable=false in columnmodel if you want to remove this option only from some column

e.taranov
6 Jun 2011, 4:44 AM
sortableColumns : Boolean
Defaults to true. Set to false to disable column sorting via clicking the header and via the Sorting menu items.

Or you have to set sortable=false in columnmodel if you want to remove this option only from some column
This is not what i asked. I need to disable rows sorting, not columns.
Ext.grid.property.Grid has default rows sorting by alpha asc, and looks like this sorting hardcoded in ext core without ability to change in config/property. Why? Any ideas?

montipirlo21
6 Jun 2011, 5:05 AM
Excuse me but i don't understand.

Grid shows the rows as they are stored in the store.
If you pass them sorted,then you'll see them sorted.

You'll do row sorting by columns not by row!!!

I think you'll have to look at you're store

remoteSort : Boolean
True to defer any sorting operation to the server. If false, sorting is done locally on the client.

Defaults to false. Maybe you're store is sorting the lines...

e.taranov
6 Jun 2011, 5:11 AM
Excuse me but i don't understand.

Grid shows the rows as they are stored in the store.
If you pass them sorted,then you'll see them sorted.

You'll do row sorting by columns not by row!!!

I think you'll have to look at you're store

remoteSort : Boolean
True to defer any sorting operation to the server. If false, sorting is done locally on the client.

Defaults to false. Maybe you're store is sorting the lines...

Property grid is not usual grid panel.
Please look at this example: http://dev.sencha.com/deploy/ext-4.0.1/examples/grid/property.html
it has property 'grouping' before 'autoFitColumns' but displayed below.
Here is source:

propsGrid.setSource({
'(name)': 'Property Grid',
grouping: false,
autoFitColumns: true,
productionQuality: true,
created: new Date(),
tested: false,
version: 0.8,
borderWidth: 2
});

pantar
24 Jan 2012, 2:32 AM
If you look into the framework's Grid.js (http://docs.sencha.com/ext-js/4-0/source/Grid.html#Ext-grid-property-Grid) file, you will find that

me.store.sort('name', 'ASC');
is called in the initComponent function. To disable sorting of data, you must override this function.
You can do that with

me.store.sort('none');

You will than have control over how your data is displayed.