Bug 1119309

Summary: sorting columns and paging
Product: Red Hat Enterprise Virtualization Manager Reporter: Michal Skrivanek <michal.skrivanek>
Component: ovirt-engineAssignee: Alexander Wels <awels>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Svaty <lsvaty>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: awels, gklein, lsurette, rbalakri, Rhev-m-bugs, srevivo, ykaul
Target Milestone: ovirt-3.6.0-rc   
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-20 01:37:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: UX RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Skrivanek 2014-07-14 13:30:07 UTC
When sorting of a column is applied the paging mechanism is problematic. 

If there is an item highlighted either jump to the correct page based on a highlight (with multiple highlights, jump just to the page of the first on) or simply always go to page 1. 

Currently we stay on the same page which may mean that the original item disappears and one needs to go and try to manually locate it on a different page.

Comment 1 Einav Cohen 2014-10-21 12:59:19 UTC
when user changes search query / when sorting applies (i.e. whenever the search is changing, except paging): 

(a) if there was a selected item: "jump" to the page that contains this selected item. 
(b) if there are multiple selected items: "jump" to the first page that contains one of them. 
(c) otherwise (fallback): go to page 1. 

[if (a)/(b) are problematic to implement - let's do only (c)]

Comment 2 Alexander Wels 2014-12-10 20:30:59 UTC
Jumping to the page that contains the selected item is going to be really difficult as I don't have that information. I could query every page until I find the one I am looking for but that could potentially require a lot of requests to find the right page. So implementing (c) is what I am going to do.

@Einav
What needs to happen to the selected item which most likely is on a page that is not shown. Should we unselect the item? It will automatically get deslected if you sort again (since now the list of items in memory does not match the selected item at all anymore, and the second search will simply clear out the selected item).

Comment 3 Einav Cohen 2014-12-10 23:03:07 UTC
(In reply to Alexander Wels from comment #2)
> Jumping to the page that contains the selected item is going to be really
> difficult as I don't have that information. I could query every page until I
> find the one I am looking for but that could potentially require a lot of
> requests to find the right page. So implementing (c) is what I am going to
> do.
> 
> @Einav
> What needs to happen to the selected item which most likely is on a page
> that is not shown. Should we unselect the item? It will automatically get
> deslected if you sort again (since now the list of items in memory does not
> match the selected item at all anymore, and the second search will simply
> clear out the selected item). 

can we select the item in case it is there (i.e. in the current page, which is the first page of the new search, in case this was triggered by sorting) and if it is not there - simply deselect it?

Comment 4 Alexander Wels 2014-12-11 12:56:38 UTC
Yes that is in my opinion the only reasonable option, if the selected item happens to show up on page 1, then keep it selected otherwise clear the selection as we have no references left to the object anyway.

Comment 5 Lukas Svaty 2015-06-18 11:15:00 UTC
verified in ovirt-engine-webadmin-portal-3.6.0-0.0.master.20150519172219.git9a2e2b3.el6.noarch