PDA

View Full Version : Ext1.0alpha1: bug or no bug in grid sorting?



Belgabor
19 Feb 2007, 8:32 AM
Hi everybody,

I started to use yui-ext last week (too impatient to wait for ext 1.0 :wink: ) and am now converting my 0.4alpha code to 1.0alpha. So far things are progressing nicely, but there is one thing which could be a bug or not. I've updated my grid according to the example and here is my record definition:


this.rec = Ext.data.Record.create([
{name: 'id', mapping: 'mediaid', type:'int'},
{name: 'name', mapping: 'name'},
{name: 'size', mapping: 'info2'},
{name: 'date', mapping: 'added'},
{name: 'comment', mapping: 'comment'},
{name: 'category', mapping: 'cat'},
{name: 'location', mapping: 'loc'}
]);


I use JSON with server side sorting and a HttpProxy in my Store. The problem/bug I see is that I get the name and not (as I would expect) the mapping of a record entry sent as 'sort' to my retrieving php script. So for example if I click on the Date column, my server gets "sort=date" instead of "sort=added".
Is this intentional or a bug?

jack.slocum
19 Feb 2007, 9:04 AM
This is intentional. Mapping cannot be used for the sort column sent to the server because suppose you have an XML document and the mapping is "details/description:first-child". That obviously isn't very useful on the server. ;)