Login Register

sort

Grid sorting problems when using dojox.data.QueryReadStore in 1.1.0 version

Hi,

When I tried to update my application from dojo 1.0.2 to dojo 1.1.0rc1 version i encountered a problem.

I am retrieving the grid data from a servlet using the dojox.data.QueryReadStore.
When I am trying to sort the table in the client side using clientSort=true all the grid data disappear and
I stay with an empty grid

The same code is working on dojo 1.0.2 version.

Here is the grid definition code:

Large ItemFileReadStore, sort totally confuzled!

I have a grid using an ItemFileReadStore (actually same thing happens with a QueryReadStore and doClientPaging=true) with a moderately large (600 record x 9 field) dataset.

Performance stinks with Firefox, and is decent with Microsoft Internet Explorer, but that's not the issue.

When I click on a column header to reverse sort, the grid seems to be quite "confused". Scrolling causes even more confusion.

(See next response - I've editing this after adding sequential numbers to the dataset to get a better picture of what's happening.)

Grid sort fails on columns containing empty cells

It seems that sorting on a column in a Grid does not work as I would expect when some of the cells in the column are empty. I have a Grid in which some of the fields are only populated for some rows. Sorting on columns with data in every row works fine, but when I sort on the columns with patchy data, the rows do get re-ordered, but in an apparently semi-random fashion, with the blank values scattered through the column, and even the rows with real values not ordered in any obvious way.

i) is this a known problem? (I searched but couldn't find anything.)

Suggestion: Allow to sub sort a column programmatically

It would be nice to have in the compare function a refernce to the row numbers.

Instead of:

model.fields.get(0).compare = function(a, b){
return (b > a ? 1 : (a == b ? 0 : -1));
}

Maybe something like:

model.fields.get(0).compare = function(a, b, aRow, bRow){
return (b > a ? 1 : (a == b ? { ... sub sort logic ... } : -1));
}

This way, when sorting by column 0 (for example) I could programmatically do a sub sort by any other column.

How do you keep dnd items in order?

I have a page with several dojo.dnd.Sources that are defined as follows in my HTML:

<div class="groupMembers" id='team1Members' dojoType="dojo.dnd.Source" accept="staff">
<script type="dojo/method" event="creator" args="item,hint">return node_creator(item,hint);

Syndicate content