Jump to content

Recommended Posts

Posted

//unitree,checkedbox

procedure TMainForm.UniBitBtn2Click(Sender: TObject);
var 
  i: integer;
begin
  for i := 0 to UniTreeView1.Items.Count - 1 do
  begin
    UniTreeView1.Items.Selected := True;
    UniSession.AddJS('if (' + UniTreeView1.JSName +
        '.getSelectionModel().hasSelection()) {' + UniTreeView1.JSName +
        '.getSelectionModel().getSelection()[0].set(''checked'', false);};');
  end;
end;

 

 

procedure TMainForm.UniBitBtn4Click(Sender: TObject);
begin
    UniSession.AddJS('alert('+UniTreeView1.JSName+'.getChecked());');
end;

 

 

checked------------node.id?node.text?...

 

 

 

post-1247-0-74684500-1388101150_thumb.jpg

Posted

function checkchange(node, checked, eOpts)

{
          if (node.hasChildNodes()) {
                  for (i = 0; i < node.childNodes.length; i++) {
                       node.childNodes.getUI().checkbox.checked = checked;
                     }
                }

}

 

node.childNodes.length-------- ok.

getUI().checkbox.checked    ?NO

Posted

// 设勾勾
procedure TuTreeViewFrame.UniBitBtn1Click(Sender: TObject);
var
  i: integer;
begin
  for i := 0 to UniTreeView1.Items.Count - 1 do
  begin
    UniTreeView1.Items.Selected := True;
    UniSession.AddJS('if (' + UniTreeView1.JSName +
        '.getSelectionModel().hasSelection()) {' + UniTreeView1.JSName +
        '.getSelectionModel().getSelection()[0].set(''checked'', false);};');
  end;
end;
//全选全不选
function checkchange(node, checked, eOpts){
if (node.hasChildNodes()) {
for (i = 0; i < node.childNodes.length; i++)
{node.childNodes.set('checked', checked);}}}
//取勾勾,无需树展开
UniSession.AddJS('alert('+UniTreeView3.JSName +'.getChecked()[1].data.text)');
//data.index:同一层的顺序号。Data.id:总的顺序号。Data.text:后面的文本。Data.checked是取值。
//getChecked()[1].id:是自带的ID
//设置新属性
procedure TUniLoginForm1.UniBitBtn11Click(Sender: TObject);
var
  i: integer;
begin
  for i := 0 to UniTreeView3.Items.Count - 1 do
  begin
    UniTreeView3.Items.Selected := True;
UniSession.AddJS('if (' + UniTreeView3.JSName +'.getSelectionModel().hasSelection()) {'
+ UniTreeView3.JSName +
'.getSelectionModel().getSelection()[0].set(''ganzq'', "'+'aaa'+inttostr(i)+'");};');
  end;
end;
//取新属性值,勾的,选的
UniSession.AddJS('alert('+UniTreeView3.JSName +'.getChecked()[0].data.ganzq)');
UniSession.AddJS('alert('+UniTreeView3.JSName +'.getSelectionModel().getSelection()[0].data.ganzq)');
function itemclick(sender, record, item, index, e, eOpts)
{alert(record.data.ganzq);}

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