Thread: Feature request: context menu column sorting

Feature request: context menu column sorting

From
Thom Brown
Date:
Hi,<br /><br />Currently on pgAdmin III, to sort a column in the Edit data screen, you have to click on the filter icon
(orselect Sort / Filter from the Tools menu) and define sorts in there.  What I'd like to be able to do is have
somethinglike the following when right-clicking on a column heading:<br /><br />Sort only by [column_name] asc<br
/>Sortonly by [column_name] desc<br />Add sort by [column_name] asc<br />Add sort by [column_name] desc<br /><br />If
youhad 2 columns already in the sort, and you selected one of the "sort only" options, it would effecitvely reset
filteringand apply it to a single column again.<br /><br />Maybe even introduce column heading highlighting for ones
whichare filtered, and an up/down arrow depicting which ordering is being used.  Sort of like this: <a
href="http://darkixion.com/pgadmin_sort.png"target="_blank">http://darkixion.com/pgadmin_sort.png</a><br /><font
color="#888888"><br/>Thom</font> 

Re: Feature request: context menu column sorting

From
Dave Page
Date:
On Wed, Feb 3, 2010 at 11:46 AM, Thom Brown <thombrown@gmail.com> wrote:
> Hi,
>
> Currently on pgAdmin III, to sort a column in the Edit data screen, you have
> to click on the filter icon (or select Sort / Filter from the Tools menu)
> and define sorts in there.

Or right-click a column and select Sort Ascending or Sort Descending.

> What I'd like to be able to do is have something
> like the following when right-clicking on a column heading:
>
> Sort only by [column_name] asc
> Sort only by [column_name] desc
> Add sort by [column_name] asc
> Add sort by [column_name] desc
>
> If you had 2 columns already in the sort, and you selected one of the "sort
> only" options, it would effecitvely reset filtering and apply it to a single
> column again.
>
> Maybe even introduce column heading highlighting for ones which are
> filtered, and an up/down arrow depicting which ordering is being used.  Sort
> of like this: http://darkixion.com/pgadmin_sort.png

Yeah, that would be handy, but I don't think we can do it with the
wxGrid control.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Feature request: context menu column sorting

From
Thom Brown
Date:
On 3 February 2010 11:57, Dave Page <dpage@pgadmin.org> wrote:
On Wed, Feb 3, 2010 at 11:46 AM, Thom Brown <thombrown@gmail.com> wrote:
> Hi,
>
> Currently on pgAdmin III, to sort a column in the Edit data screen, you have
> to click on the filter icon (or select Sort / Filter from the Tools menu)
> and define sorts in there.

Or right-click a column and select Sort Ascending or Sort Descending.

Really?  That doesn't work on mine (v1.10.1).  I get greyed out copy/paste/delete options.

Thom

Re: Feature request: context menu column sorting

From
Dave Page
Date:
On Wed, Feb 3, 2010 at 11:58 AM, Thom Brown <thombrown@gmail.com> wrote:
> On 3 February 2010 11:57, Dave Page <dpage@pgadmin.org> wrote:
>>
>> On Wed, Feb 3, 2010 at 11:46 AM, Thom Brown <thombrown@gmail.com> wrote:
>> > Hi,
>> >
>> > Currently on pgAdmin III, to sort a column in the Edit data screen, you
>> > have
>> > to click on the filter icon (or select Sort / Filter from the Tools
>> > menu)
>> > and define sorts in there.
>>
>> Or right-click a column and select Sort Ascending or Sort Descending.
>
> Really?  That doesn't work on mine (v1.10.1).  I get greyed out
> copy/paste/delete options.

Right-click over the data, not the header.


--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Feature request: context menu column sorting

From
Thom Brown
Date:
On 3 February 2010 12:00, Dave Page <dpage@pgadmin.org> wrote:
On Wed, Feb 3, 2010 at 11:58 AM, Thom Brown <thombrown@gmail.com> wrote:
> On 3 February 2010 11:57, Dave Page <dpage@pgadmin.org> wrote:
>>
>> On Wed, Feb 3, 2010 at 11:46 AM, Thom Brown <thombrown@gmail.com> wrote:
>> > Hi,
>> >
>> > Currently on pgAdmin III, to sort a column in the Edit data screen, you
>> > have
>> > to click on the filter icon (or select Sort / Filter from the Tools
>> > menu)
>> > and define sorts in there.
>>
>> Or right-click a column and select Sort Ascending or Sort Descending.
>
> Really?  That doesn't work on mine (v1.10.1).  I get greyed out
> copy/paste/delete options.

Right-click over the data, not the header.


D'oh!  Still, I'd like to see that (or one relevant to a column, not a cell) on right-clicking the header.

As for wxGrid, can't you use EVT_GRID_LABEL_RIGHT_CLICK on header to call wxGrid::SetCellBackgroundColour or wxGrid::SetLabelBackgroundColour?

Thom

Re: Feature request: context menu column sorting

From
Dave Page
Date:
On Wed, Feb 3, 2010 at 12:03 PM, Thom Brown <thombrown@gmail.com> wrote:

> D'oh!  Still, I'd like to see that (or one relevant to a column, not a cell)
> on right-clicking the header.

Yeah, not sure why it isn't.

> As for wxGrid, can't you use EVT_GRID_LABEL_RIGHT_CLICK on header to call
> wxGrid::SetCellBackgroundColour or wxGrid::SetLabelBackgroundColour?

Setting the background colour isn't the issue, it's adding an icon to
indicate the sort direction which is the most valuable indicator imho.


--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Feature request: context menu column sorting

From
Thom Brown
Date:
On 3 February 2010 12:22, Dave Page <dpage@pgadmin.org> wrote:
>
> Setting the background colour isn't the issue, it's adding an icon to
> indicate the sort direction which is the most valuable indicator imho.
>

Yes, and when you pointed out that I could right-click a cell and
select sorting options there, I found the sort I selected had no
effect, due to the fact that the first column was sorted by default
(probably because it's the primary key or something).  I consider this
to be a gotcha.  And yes, it's not clear what the active filters are,
or what order they are being applied in.  If there were some way to
provide visual feedback on this, it would be helpful.  Maybe something
like adding an extra textual row within the header to indicate the
current filters and their order?

Like:

id         name              age
int        varchar(64)      int
asc(1)                        desc(2)

Although this isn't as elegant a solution as I'd want personally.

Thom


Re: Feature request: context menu column sorting

From
Dave Page
Date:
On Wed, Feb 3, 2010 at 12:30 PM, Thom Brown <thombrown@gmail.com> wrote:
> On 3 February 2010 12:22, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Setting the background colour isn't the issue, it's adding an icon to
>> indicate the sort direction which is the most valuable indicator imho.
>>
>
> Yes, and when you pointed out that I could right-click a cell and
> select sorting options there, I found the sort I selected had no
> effect, due to the fact that the first column was sorted by default
> (probably because it's the primary key or something).  I consider this
> to be a gotcha.  And yes, it's not clear what the active filters are,
> or what order they are being applied in.  If there were some way to
> provide visual feedback on this, it would be helpful.  Maybe something
> like adding an extra textual row within the header to indicate the
> current filters and their order?
>
> Like:
>
> id         name              age
> int        varchar(64)      int
> asc(1)                        desc(2)
>
> Although this isn't as elegant a solution as I'd want personally.

Yeah, we'd need to find something nicer than that. Those headers are
already taller than I like.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Feature request: context menu column sorting

From
Thom Brown
Date:
On 3 February 2010 13:40, Dave Page <dpage@pgadmin.org> wrote:
> On Wed, Feb 3, 2010 at 12:30 PM, Thom Brown <thombrown@gmail.com> wrote:
>> On 3 February 2010 12:22, Dave Page <dpage@pgadmin.org> wrote:
>>>
>>> Setting the background colour isn't the issue, it's adding an icon to
>>> indicate the sort direction which is the most valuable indicator imho.
>>>
>>
>> Yes, and when you pointed out that I could right-click a cell and
>> select sorting options there, I found the sort I selected had no
>> effect, due to the fact that the first column was sorted by default
>> (probably because it's the primary key or something).  I consider this
>> to be a gotcha.  And yes, it's not clear what the active filters are,
>> or what order they are being applied in.  If there were some way to
>> provide visual feedback on this, it would be helpful.  Maybe something
>> like adding an extra textual row within the header to indicate the
>> current filters and their order?
>>
>> Like:
>>
>> id         name              age
>> int        varchar(64)      int
>> asc(1)                        desc(2)
>>
>> Although this isn't as elegant a solution as I'd want personally.
>
> Yeah, we'd need to find something nicer than that. Those headers are
> already taller than I like.
>

And going back to the greyed out copy/paste/delete options, why can't
we copy a column or a range of cells?  For example, if I select the
equivalent of B4 through C10, upon right-clicking on that range I'd
want to see an option that would let me copy what has been selected.
And also if the data grid is editable, selecting the whole grid and
selecting copy also copies in the new row from the bottom.

It's really just to make things more intuitive and flexible.  I still
can't think of a neat solution for displaying the column sorting
though.

Thom


Re: Feature request: context menu column sorting

From
Dave Page
Date:
On Wed, Feb 3, 2010 at 1:47 PM, Thom Brown <thombrown@gmail.com> wrote:

> And going back to the greyed out copy/paste/delete options, why can't
> we copy a column or a range of cells?

You can. Hit ctrl+c or press the Copy button.

> For example, if I select the
> equivalent of B4 through C10, upon right-clicking on that range I'd
> want to see an option that would let me copy what has been selected.

I'm not sure where the disabled cut/copy/paste context menu is coming
from. I assume it must be in wxWidgets but... what OS are you using?

> And also if the data grid is editable, selecting the whole grid and
> selecting copy also copies in the new row from the bottom.

Thats a bug. Not sure if it's ours or not though without further digging.

/D

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Feature request: context menu column sorting

From
Michael Shapiro
Date:
It looks like you can. ctrl-c will copy what is highlighted<br /><br /><div class="gmail_quote">On Wed, Feb 3, 2010 at
7:47AM, Thom Brown <span dir="ltr"><<a href="mailto:thombrown@gmail.com">thombrown@gmail.com</a>></span>
wrote:<br/><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex;
padding-left:1ex;"><br /> And going back to the greyed out copy/paste/delete options, why can't<br /> we copy a column
ora range of cells?  For example, if I select the<br /> equivalent of B4 through C10, upon right-clicking on that range
I'd<br/> want to see an option that would let me copy what has been selected.<font color="#888888"><a
href="http://www.postgresql.org/mailpref/pgadmin-support"target="_blank"></a><br /></font></blockquote></div><br /> 

Re: Feature request: context menu column sorting

From
Thom Brown
Date:
On 3 February 2010 14:01, Dave Page <dpage@pgadmin.org> wrote:
>> For example, if I select the
>> equivalent of B4 through C10, upon right-clicking on that range I'd
>> want to see an option that would let me copy what has been selected.
>
> I'm not sure where the disabled cut/copy/paste context menu is coming
> from. I assume it must be in wxWidgets but... what OS are you using?

At work, Windows.  The disabled context menu comes when right-clicking
on the header.  The frmEditGrid::OnLabelRightClick function shows
these being intentional.

Thom


Re: Feature request: context menu column sorting

From
Guillaume Lelarge
Date:
Le 03/02/2010 15:32, Thom Brown a écrit :
> On 3 February 2010 14:01, Dave Page <dpage@pgadmin.org> wrote:
>>> For example, if I select the
>>> equivalent of B4 through C10, upon right-clicking on that range I'd
>>> want to see an option that would let me copy what has been selected.
>>
>> I'm not sure where the disabled cut/copy/paste context menu is coming
>> from. I assume it must be in wxWidgets but... what OS are you using?
> 
> At work, Windows.  The disabled context menu comes when right-clicking
> on the header.  The frmEditGrid::OnLabelRightClick function shows
> these being intentional.
> 

Just got home. This thread is interesting. It's been quite some time
that I wanted to create our own wxGrid widget. Something that will allow
us to sort, filter more easily than the one we have now. Now that I know
how to build a custom widget, it should be simpler. But I didn't find
the time to work on this (alas, there are lots of things like that).


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: Feature request: context menu column sorting

From
Quan Zongliang
Date:
On 2010-2-4 2:56, Guillaume Lelarge wrote:
> Just got home. This thread is interesting. It's been quite some time
> that I wanted to create our own wxGrid widget. Something that will allow
> us to sort, filter more easily than the one we have now. Now that I know
> how to build a custom widget, it should be simpler. But I didn't find
> the time to work on this (alas, there are lots of things like that).
>
>    
The special things are needed by db operation.
We should create our own Grid class.


Re: Feature request: context menu column sorting

From
Dave Page
Date:
On Wed, Feb 3, 2010 at 11:40 PM, Quan Zongliang <quanzongliang@gmail.com> wrote:
> On 2010-2-4 2:56, Guillaume Lelarge wrote:
>>
>> Just got home. This thread is interesting. It's been quite some time
>> that I wanted to create our own wxGrid widget. Something that will allow
>> us to sort, filter more easily than the one we have now. Now that I know
>> how to build a custom widget, it should be simpler. But I didn't find
>> the time to work on this (alas, there are lots of things like that).
>>
>>
>
> The special things are needed by db operation.
> We should create our own Grid class.
>

Well it's a nice idea, but I have the distinct feeling you may both
have underestimated just how much work would be involved in
implementing a new grid control.

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Feature request: context menu column sorting

From
Guillaume Lelarge
Date:
Le 04/02/2010 09:39, Dave Page a écrit :
> On Wed, Feb 3, 2010 at 11:40 PM, Quan Zongliang <quanzongliang@gmail.com> wrote:
>> On 2010-2-4 2:56, Guillaume Lelarge wrote:
>>>
>>> Just got home. This thread is interesting. It's been quite some time
>>> that I wanted to create our own wxGrid widget. Something that will allow
>>> us to sort, filter more easily than the one we have now. Now that I know
>>> how to build a custom widget, it should be simpler. But I didn't find
>>> the time to work on this (alas, there are lots of things like that).
>>>
>>>
>>
>> The special things are needed by db operation.
>> We should create our own Grid class.
>>
> 
> Well it's a nice idea, but I have the distinct feeling you may both
> have underestimated just how much work would be involved in
> implementing a new grid control.
> 

I don't think I have. That's surely why I still didn't work on it :)


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com