Jump to content
uniGUI Discussion Forums
Sign in to follow this  
delagoutte

UniDBTreeGrid with multiselect and checkbox

Recommended Posts

Hello,

 

Let's start with this, can you try?

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

Share this post


Link to post
Share on other sites

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
"

Share this post


Link to post
Share on other sites

Yes, can you try with this option for now?

 

UniDBTreeGrid -> Options -> dgDontShowSelected=True

Share this post


Link to post
Share on other sites

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 ?

Share this post


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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×