Jump to content

UniDBTreeGrid with multiselect and checkbox


delagoutte

Recommended Posts

it is better ,now i don't have any error message buti have a new problem.

i try to get the list of selected row with the method that i use for grid :

//TGLots : TDBUnitreegrid;
//dsLotsRO : datasource that is linked with the treegrid  
dsLotsRO.DisableControls;
    try
      for I := 0 to TGLots.SelectedRows.Count - 1 do
      begin
        dsLotsRO.Bookmark := TGLots.SelectedRows[I];
        aLstLot.Add(dsLotsRO.fieldByName('LRO_ID').asstring);
      end;
    finally
      dsLotsRO.EnableControls;
    end;

but SelectedRows.Count is always with 0.

i try to work with onselectionchange but the event is not fire.

How can i do ?

Link to comment
Share on other sites

Try with this approach for now...:

 

1.

function select(sender, record, index, eOpts)
{
    var IDs = "";
    this.getSelection().forEach(function (rec) {if (IDs == "") {IDs = rec.data[yourIDIndx]} else {IDs = IDs + "," + rec.data[yourIDIndx]}});
    ajaxRequest(this, "_getSelection", ['IDs=' + IDs]);
}

2.

procedure TMainForm.UniDBTreeGrid1AjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if EventName = '_getSelection' then begin
    ShowMessage(Params.Values['IDs']);
  end;
end;
Link to comment
Share on other sites

  • 3 years later...
On 6/14/2018 at 6:29 PM, Sherzod said:

Try with this approach for now...:

 

1.



function select(sender, record, index, eOpts)
{
    var IDs = "";
    this.getSelection().forEach(function (rec) {if (IDs == "") {IDs = rec.data[yourIDIndx]} else {IDs = IDs + "," + rec.data[yourIDIndx]}});
    ajaxRequest(this, "_getSelection", ['IDs=' + IDs]);
}

2.



procedure TMainForm.UniDBTreeGrid1AjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if EventName = '_getSelection' then begin
    ShowMessage(Params.Values['IDs']);
  end;
end;

Добрый день! а как реализовать выборку по группе? Чтобы возвращал список ID всех записей в родительском ноде

 

540972102_.png.c071ab0c75bd2a343206d2025b7a10ff.png

 

Link to comment
Share on other sites

1 hour ago, =GGG= said:

Добрый день! а как реализовать выборку по группе? Чтобы возвращал список ID всех записей в родительском ноде

 

540972102_.png.c071ab0c75bd2a343206d2025b7a10ff.png

 

событие checkChange не работает

1367196639_.thumb.png.e51ba79a66a5f10cc7d987698d8457be.png

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...