uniguicn Posted August 23, 2013 Share Posted August 23, 2013 unitreeview node checkbox, how? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 2, 2013 Share Posted October 2, 2013 Hi uniguicn. Yes, this feature is currently not implemented. But you can implement it this way: uses ... uniGUIApplication ... procedure TMainForm.UniButton1Click(Sender: TObject); var node: TUniTreeNode; begin //node := UniTreeView1.Items.AddChild(SelectedNode, 'TestNode'); node := UniTreeView1.Items.AddChild(nil, 'TestNode'); node.Selected := True; //set(''checked'', false); OR set(''checked'', true); UniSession.AddJS('if (' + UniTreeView1.JSName + '.getSelectionModel().hasSelection()) {'+UniTreeView1.JSName+'.getSelectionModel().getSelection()[0].set(''checked'', false);};'); end; Sincerely ... 1 Quote Link to comment Share on other sites More sharing options...
movedown Posted November 14, 2013 Share Posted November 14, 2013 good example! Quote Link to comment Share on other sites More sharing options...
memoferprof Posted January 23, 2014 Share Posted January 23, 2014 yes good example! how can autogenerate subnode on node parents, like this example but with a select date_format(m.fecha, '%Y/%c/%d') fecha,u.id_usuario, u.usuario recibe,m.id_mensaje, m.mensaje from mensaje m, usuarios u where m.id_usuarioe = u.id_usuario and m.recibido = 1 and m.id_usuarior = 3 and m.id_usuarioe = 5 order by m.id_mensaje using field mensaje for all dates with the same date. like this image: PLEASE HELP ME. THANK YOU Quote Link to comment Share on other sites More sharing options...
memoferprof Posted January 23, 2014 Share Posted January 23, 2014 Workaround: I use this code UniMainModule.MyQuerytempo.SQL.Clear; UniMainModule.MyQuerytempo.Close; UniMainModule.MyQuerytempo.SQL.Add('select date_format(m.fecha, ''%Y/%c/%d'') fecha, count(*) cuantos from mensaje m, usuarios u where m.id_usuarioe = u.id_usuario and m.recibido = 1 and m.id_usuarior = :precibe and m.id_usuarioe = :penvia group by date_format(m.fecha, ''%Y/%c/%d'')'); UniMainModule.MyQuerytempo.ParamByName('precibe').AsInteger := receptor; UniMainModule.MyQuerytempo.ParamByName('penvia').AsInteger := emisor; UniMainModule.MyQuerytempo.Open; //UniTreeView1.Items.Clear; // en lugar de usar el CLEAR, while UniTreeView1.Items.Count > 0 do begin // se usara este ciclo procedimiento que nos limpiara UniTreeView1.Items[0].Free; // desde el primero hasta el ultimo end; // siempre borrando el primero, hasta que no exista nada while not UniMainModule.MyQuerytempo.Eof do begin UniTreeView1.Items.AddChild(SelectedNode,UniMainModule.MyQuerytempo.FieldByName('fecha').AsString); UniMainModule.MyQuerytempo.Next; end; UniMainModule.MyQuerytempo.SQL.Clear; UniMainModule.MyQuerytempo.Close; UniMainModule.MyQuerytempo.SQL.Add('select date_format(m.fecha, ''%Y/%c/%d'') fecha,u.id_usuario, u.usuario recibe,m.id_mensaje, m.mensaje'+' from mensaje m, usuarios u where m.id_usuarioe = u.id_usuario and m.recibido = 1 and m.id_usuarior = :precibe and m.id_usuarioe = :penvia order by m.id_mensaje'); UniMainModule.MyQuerytempo.ParamByName('precibe').AsInteger := receptor; UniMainModule.MyQuerytempo.ParamByName('penvia').AsInteger := emisor; UniMainModule.MyQuerytempo.Open; while not UniMainModule.MyQuerytempo.Eof do begin for i := 0 to UniTreeView1.Items.Count do begin if UniTreeView1.Items[i].Text = unimainmodule.MyQuerytempo.FieldByName('fecha').AsString then begin UniTreeView1.Items.AddChild(UniTreeView1.Items[i],unimainmodule.MyQuerytempo.FieldByName('mensaje').AsString); UniMainModule.MyQuerytempo.Next; end; end; end; Quote Link to comment Share on other sites More sharing options...
tappatappa Posted January 27, 2014 Share Posted January 27, 2014 I guess this is not a bug? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.