Jump to content


Photo

UniDBTreeGrid with multiselect and checkbox


  • Please log in to reply
6 replies to this topic

#1 delagoutte

delagoutte

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 336 posts

Posted 12 June 2018 - 02:27 PM

Hello,

is it possible to activate row select with unidbtreegrid like one of the solution that are in fiddle in this page https://www.sencha.c...-Checkbox-Model

 

ps : i am using the version with extjs 4


  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 12 June 2018 - 04:44 PM

Hello,

 

Let's start with this, can you try?

function beforeInit(sender, config)
{
    config.selModel = {
        selType: 'checkboxmodel',
        mode: 'MULTI'
    };
}

  • 0

#3 delagoutte

delagoutte

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 336 posts

Posted 13 June 2018 - 09:06 AM

there is the column with selection checkbox but just after display the form i have this error message "

Could not set cell position: row: [0], column:[1] :D.view is undefined
"

  • 0

#4 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 13 June 2018 - 09:17 AM

Yes, can you try with this option for now?

 

UniDBTreeGrid -> Options -> dgDontShowSelected=True


  • 0

#5 delagoutte

delagoutte

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 336 posts

Posted 13 June 2018 - 09:58 AM

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 ?


  • 0

#6 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 13 June 2018 - 11:08 AM

Ok, I will let you know


  • 0

#7 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 14 June 2018 - 12:29 PM

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;

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users