RC2: problem on sort list filed with valueMap

Hi,
I have this ListGridField:

{name:"levelID", title:"Level", width:100, optionDataSource:"levelDS", valueField:"id", displayField:"value", align:"left"},

when I try to sort this column on network the POST message has:

sortBy = -value

Instead of

sortBy = -levelID

The same works as expected without valueMap.

Seem that when is present value map, the sortBy field name is taken from “displayField” field instead of “name” filed.

The exaple worked as expected in RC1.

Can you help me please.
Thaks!

Hi Xandros,

This sounds like it’s working as designed:
If the optionDataSource for a field matches the underlying dataSource for the grid, and a valueField/displayfield is specified, we sort by the display field.

The user experience is therefore this: the user clicks on a header to sort by the field and the records show up sorted in the order of the visible values within the field.
If we sorted by the underlying data values, the sort would appear arbitrary to the user.

Can you let us know what your use case is and why this behavior isn’t matching your expectations?

Thanks
Isomorphic Software

My problem is with the value passed over network to the server.
If my listgrid field is named “levelID” and I sort by it, I expect that the server receive this field in “sortBy” metadata sended to it and not “value” that is the “displayField” of valueMap and that should be used exclusivly to retrive value to show in filed/filter.
Where I wrong?

Hi Xandros,

I realize that in my previous post I made a mistake: In the 7.0 RC2 build we do indeed pass the displayField (in your case “value”) to the server when performing a server-side sort even if the optionDataSource for the field differs from the specified dataSource for the ListGrid.
This is a bug, and has already been fixed internally. The fix will be present in 7.0 final.

Thanks
Isomorphic Software

OK, thanks.
Can you share me the patch fixing please?
I will remove it after 7.0final release.

Thaks

Sorry Xandros, we don’t generally patch non-final releases unless you have Enterprise Support and have asked for certification on an interim release.