Jump to content

Dbgrid selection doesn't work


eduardosuruagy

Recommended Posts

35 minutes ago, eduardosuruagy said:

Just look at the video at the beginning of this topic, I need to click on the option to mark all records, which is not working. When I put any function to sort the grid this option to mark all the records stops working since I can't remove the sorting grid option, except you have another option that works along with the selection of the records.

Please tell me, what do you want to achieve in general - without using extra codes ?

Link to comment
Share on other sites

On 10/15/2019 at 11:17 PM, Sherzod said:
On 10/15/2019 at 10:56 PM, eduardosuruagy said:

any news?

In your case, just try without this:


//  UniDBGrid1.ClientEvents.ExtEvents.Add(
//  'headerclick=function headerclick(ct, column, e, t, eOpts)'#13#10'{'#13#10'  ' +
//  ''+Self.Name+'.'+UniDBGrid1.DataSource.DataSet.Name+'.getStore().sort(column.dataIndex);'#13 + #10'}');

I already gave you a solution for your test case, it seems you have not checked.

Link to comment
Share on other sites

6 minutes ago, Sherzod said:

Eu já lhe dei uma solução para o seu caso de teste, parece que você não verificou.

This I already did, but how do I sort the records when clicking on any column of the grid? If I remove this option it does not order. If you have another way of doing it that would be great.
Is there any way to click a button and mark all grid records? No need to click on the selection column.

Link to comment
Share on other sites

1 minute ago, eduardosuruagy said:

This I already did, but how do I sort the records when clicking on any column of the grid? If I remove this option it does not order. If you have another way of doing it that would be great.

In your testcase you have:

1. Use it:

UniDBGrid1.ClientEvents.UniEvents.Add(
  'store.afterCreate=function store.afterCreate(sender)'#13#10'{'#13#10''+
  '  sender.setRemoteSort(false);'#13#10'}');

2. Don't use:

//  UniDBGrid1.ClientEvents.ExtEvents.Add(
//  'headerclick=function headerclick(ct, column, e, t, eOpts)'#13#10'{'#13#10'  ' +
//  ''+Self.Name+'.'+UniDBGrid1.DataSource.DataSet.Name+'.getStore().sort(column.dataIndex);'#13 + #10'}');

 

Link to comment
Share on other sites

2 minutes ago, Sherzod said:

In your testcase you have:

1. Use it:


UniDBGrid1.ClientEvents.UniEvents.Add(
  'store.afterCreate=function store.afterCreate(sender)'#13#10'{'#13#10''+
  '  sender.setRemoteSort(false);'#13#10'}');

2. Don't use:


//  UniDBGrid1.ClientEvents.ExtEvents.Add(
//  'headerclick=function headerclick(ct, column, e, t, eOpts)'#13#10'{'#13#10'  ' +
//  ''+Self.Name+'.'+UniDBGrid1.DataSource.DataSet.Name+'.getStore().sort(column.dataIndex);'#13 + #10'}');

 

Perfect, thank you so much ... I mean I don't need this code to sort?
UniDBGrid1.ClientEvents.ExtEvents.Add (
  'headerclick = function headerclick (ct, column, e, t, eOpts)' # 13 # 10 '{' # 13 # 10 '' +
'' + Self.Name + '.' + UniDBGrid1.DataSource.DataSet.Name + '. GetStore (). Sort (column.dataI ndex);' # 13 + # 10 '}');

Link to comment
Share on other sites

2 minutes ago, eduardosuruagy said:

I mean I don't need this code to sort?

Yes you do not need, if you are using:

5 minutes ago, Sherzod said:

UniDBGrid1.ClientEvents.UniEvents.Add(   'store.afterCreate=function store.afterCreate(sender)'#13#10'{'#13#10''+   '  sender.setRemoteSort(false);'#13#10'}');

 

2 minutes ago, Sherzod said:

And those columns that you want to sort locally:


UniDBGrid.Columns[xx].Sortable = True

 

Link to comment
Share on other sites

7 minutes ago, Sherzod said:

Sim, você não precisa se estiver usando:

 

 

One more question, I have a css code that changes the color of the line that is positioned the cursor, but note that in grid 1 this color only appears when I mark the record, has it appear even if the record is not checked?

.x-grid-item-selected {
    color: #404040;
    background-color: #ffefbb;
}
 

Demo.gif

Link to comment
Share on other sites

2 minutes ago, eduardosuruagy said:

One more question, I have a css code that changes the color of the line that is positioned the cursor, but note that in grid 1 this color only appears when I mark the record, has it appear even if the record is not checked?

UniDBGrid.Options -> dgCheckSelectCheckOnly = False

Link to comment
Share on other sites

14 minutes ago, eduardosuruagy said:

I was thinking of another option, because if I uncheck dgCheckSelectCheckOnly, when I'm marking records and clicking anywhere else on the grid, all other records I've checked are automatically cleared.

Well there must be a balance...

\FMSoft\Framework\uniGUI\Demos\Desktop\GridMultiSelect

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...