Jump to content

DBGrid Clientside Sorting


mhmda

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 :-)

 

  • Like 1
  • Upvote 4
Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...
  • 2 months later...
  • 3 weeks later...
  • 2 months later...
  • 6 months later...
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;

}

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

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,

Link to comment
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,

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...