ganzqgy Posted December 26, 2013 Posted December 26, 2013 //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?... Quote
ganzqgy Posted January 3, 2014 Author Posted January 3, 2014 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 Quote
ganzqgy Posted January 4, 2014 Author Posted January 4, 2014 getChecked()[1].data.text----------------ok! good! Quote
ganzqgy Posted January 5, 2014 Author Posted January 5, 2014 // 设勾勾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);} Quote
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.