Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baseSort clarification #75

Open
tsemachh opened this issue May 19, 2013 · 11 comments
Open

baseSort clarification #75

tsemachh opened this issue May 19, 2013 · 11 comments

Comments

@tsemachh
Copy link

Hi
looking at baseSort Doc :
from https://github.com/oria/gridx/wiki/How-to-Sort-a-Column-in-Gridx

And you can never clear the sort. The data in grid will appear that this is its "base" order, and you can only sort on the base of it, and clear back to it.

What I saw and tested:

  1. When this is set with no initialOrder this works as expected , also when sort is cleared this goes back to it.
  2. When initialOrder is set or when user performs sort Operation the sorting is not done on the base of it , it just overrides it.
    So my understanding - it just gives the default base Order before sort is invoked by user from API/UI - this is now what I understood from the Wiki.

Can you please clarify it ?
thx
tsemach.

@yurychika
Copy link
Collaborator

Can you tell me what kind of store are you using? Memory store or JsonRestStore ?

@tsemachh
Copy link
Author

Actually dojo/store/DataStore on top of DWR Store..
But I saw it also on the tests on the Demo like:
/test_grid_nestedSort.html
When I played with the baseSort as followed:

  baseSort: [{attribute: 'Year', descending: true}],
    sortInitialOrder: [{colId: 'id', descending: true}, {colId: 'Name', descending: false}],

The actual sort was ignoring the baseSort , and also if I removed the sortInitialOrder after sorting it was ignoring that as well

@yurychika
Copy link
Collaborator

I need to verify with the module writter to see if this is a truely a defect.

Can you please try

                    // sortSpec = sortSpec.concat(bs);
                    sortSpec = bs.concat(sortSpec);

in /gridx/core/model/extension/sort.js

to see if it meet your needs.

@tsemachh
Copy link
Author

Yup - this works as expected , I am not sure if that's the design but the documentation is in that spirit.
thank you.

@yurychika
Copy link
Collaborator

I will double check with @zhuxw .
thanks for the support.

@EricDeCoff
Copy link

Problem with Sorting with Tree Module ( 3 level nesting )

Is there a way to say column 1 , 2 , 3 must be sorted together?

IE: columns ( isle, racks, shelf )
when you expand isle tree and sort on isle again..
the racks don't follow the isle....

@tsemachh
Copy link
Author

tsemachh commented Jun 9, 2013

Once the fix will be on Master and assuming the sort there goes through same code ,
using the baseSort will provide you the capability of sorting on top of fixed base sort ,
in tree it will usually be the tree break levels columns.

@EricDeCoff
Copy link

Tsemachh.....

Thank you... So is that fix coming soon or in GridX 1.2 .... ???

@tsemachh
Copy link
Author

I am back to it now , It's still not fixed in lastest Code I took from Master - can you please check it again ?

@keeganmccallum
Copy link

+1 for this, it is just a one line change, would be nice to have this merged into the repo

@keeganmccallum
Copy link

#353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants