Jump to content
uniGUI Discussion Forums
mhmda

DBGrid Clientside Sorting

Recommended Posts

Hi,

 

As default behavior of dbgrid is performing sorting in server side, but sometimes you fetch all data into grid (no paging) and the data is already in client, so why return to server to sort data !!

 

Do the sort in client side:

 

1. Disable remoteSort (store):

 

s1.png

 

 

 

2. Set 'click' event on column header and do sorting:

 

s2.png

 

 

Hope this will help you :-)

 

  • Upvote 4

Share this post


Link to post
Share on other sites

I do not have the event Ext.data.Store  -> store.afterCreate

 

I tried to put the event Ext.grid.Panle -> headerclick but it did not work. any ideas?

 

Regards,

Share this post


Link to post
Share on other sites

Thank you...
How to sort all the data in the grid.
This process only sees the page you are on ..

 

teşekkürler...
Grid içerisindeki Tüm dataları nasıl sıralarız.
Bu İşlem Sadece Bulunduğu Sayfayı Sıralıyor..

Share this post


Link to post
Share on other sites

Super !!

 

it works just fine ! (:

 

Thank you very much delagoutte  :)

 

nb: My manager don't like Js, so I might use this solution in last resort, I'm going to answer to your other post  ^_^

Share this post


Link to post
Share on other sites

hi, I tried your code, but not successful. what is frmcaseview?do i need to change something with my dlphi component's  name?

Share this post


Link to post
Share on other sites

Hi,

 

hi, I tried your code, but not successful. what is frmcaseview?do i need to change something with my dlphi component's  name?

 

Which edition and build are you using ?!

 

Best regards,

Share this post


Link to post
Share on other sites
I have a problem in dbgrid, when I click on the column to sort LoadMask appears at the time of the click but it does not undo, with the screen stuck and the column does not sort. I'm using the option of our friend Mohammad.

 

function headerclick (ct, column, e, t, eOpts)

{

   Frame.dbgrid.getStore (). Sort (column.dataIndex);

}

 

function store.afterCreate (sender)

{

   sender.remoteSort = false;

}

Share this post


Link to post
Share on other sites

Hello there ! (:

 

You should try this out :

  UniSession.AddJS(UniDBGrid1.JSName+'.store.getSorters().add(new Ext.util.Sorter({property: 1,direction: "DESC"}));');

^_^

Share this post


Link to post
Share on other sites

Hello UniGUI users ! (:

I have a question concerning sorting..

at the moment, I cancel a specific sort like that:

  UniSession.AddJS(uniDBGrid1.JSName + '.getStore().sorters.remove('+IntToStr(UniDBGrid1.CurrCol)+');');
  UniSession.AddJS(UniDBGrid1.JSName+'.getView().refresh();');

If it's the only sort that was on the grid, the order of aggregats does not change. Then if I wants to apply the same sort on the same column, sorting is indeed visible on the interface, but event UniDBGrid1MultiColumnSort is not fired.. is this normal behavior ?

What can I do to force the fire of this event ? (We have our own logic so it is unfortunate if event is not fired..)

Regards,

Share this post


Link to post
Share on other sites

Hello Sherzod,

Yeah I know this post, and yes my config.multiColumnSort is set to true.

I think that this issue append when your datas are already sorted and that you sort request does not change it. In that case only, event multiColumnSort is not fired.

Can you reproduce ? if not, I will make a testCase tomorrow! (I already tested it in a minimalist project).

Regards,

 

Share this post


Link to post
Share on other sites

×