Jump to content

TUniDBGrid doesn't have properties SelectAll and UnSelectAll


Recommended Posts

Hi,

 

For now can you try this?!:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniDBGrid1.JSInterface.JSCall('getSelectionModel().selectAll', []);
end;

procedure TMainForm.UniButton2Click(Sender: TObject);
begin
  UniDBGrid1.JSInterface.JSCall('getSelectionModel().deselectAll', []);
end;

Best regards.

Link to post
Share on other sites

Hi all,

 

If DBGrid finde this situation:

procedure TfrmXXX.gridMainMouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  If Shift=[ssAlt] Then
    inherited;  //
end;

procedure TfrmXXX.gridMainMouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  If Shift=[ssAlt] Then
    inherited;  //
end;

Value of Shift is always '[]'. i.e. i can't catch pressed button SHIFT, ALT, CTRL.

 

What is this, bug? 

Link to post
Share on other sites

 

Which build are you using?!

 

Also you can use like this:

UniSession.AddJS(UniDBGrid1.JSName + '.getSelectionModel().selectAll();');
UniSession.AddJS(UniDBGrid1.JSName + '.getSelectionModel().deselectAll();');

 

 

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniSession.AddJS(UniDBGrid1.JSName + '.getSelectionModel().selectAll');
 
  ShowMessage(IntToStr(UniDBGrid1.SelectedRows.Count));
end;
 
 
After clicking on button it will not showing the count of all rows and not selecting all records. Is that need anything else to call that JS?
Link to post
Share on other sites

 

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniSession.AddJS(UniDBGrid1.JSName + '.getSelectionModel().selectAll');
 
  ShowMessage(IntToStr(UniDBGrid1.SelectedRows.Count));
end;
 
 
After clicking on button it will not showing the count of all rows and not selecting all records. Is that need anything else to call that JS?

 

 

UniSession.AddJS(UniDBGrid1.JSName + '.getSelectionModel().selectAll');

 

Correct:

UniSession.AddJS(UniDBGrid1.JSName + '.getSelectionModel().selectAll();');

Link to post
Share on other sites
procedure TMainForm.SelectALLClick(Sender: TObject);

begin

  UniSession.AddJS(UniDBGrid1.JSName + '.getSelectionModel().selectAll();');

  ShowMessage(inttostr(UniDBGrid1.SelectedRows.Count));

end;

 

procedure TMainForm.UnSelectAllClick(Sender: TObject);

begin

  UniSession.AddJS(UniDBGrid1.JSName + '.getSelectionModel().deselectAll()');

  ShowMessage(inttostr(UniDBGrid1.SelectedRows.Count));

end;

 

In my case it not showing proper count of the selected records.

 

If I select 2 record and then click on SelectALL it gives me count is 2 after that if  I click on UnSelectAll it gives me total count and again If I click on SelectALL it gives me count 0. I am not sure what I missing. 

Link to post
Share on other sites

Hi,

 

In my case it not showing proper count of the selected records.

 
If I select 2 record and then click on SelectALL it gives me count is 2 after that if  I click on UnSelectAll it gives me total count and again If I click on SelectALL it gives me count 0. I am not sure what I missing. 

 

 

Then try this:

 

1. UniButton1 (selectAll):

 

UniButton1->ClientEvents->ExtEvents-> click fn:

function click(sender, e, eOpts)
{
    MainForm.UniDBGrid1.getSelectionModel().selectAll();
}
procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  ShowMessage(inttostr(UniDBGrid1.SelectedRows.Count));
end;

2. UniButton2 (deselectAll): ...

Link to post
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...