Page 1 of 1 1
Topic Options
#212713 - 2017-10-06 10:06 AM [Kixforms-Classic TreeView] SelectedNode
AndreLuiz Offline
Getting the hang of it

Registered: 2015-10-07
Posts: 71
Loc: Brasil, João pessoa
Kixforms-Classic 2.4.6

[PTBR]
Olá a todo eu não estou conseguindo selecionar um node, não sei, mas acredito que seja a sintaxe que estou usando errado.

É desta forma que se usa, eu não entendi!

[ENG]
Hello to all I'm not achieved, select a node, I do not know, but believe me it's a syntax that I'm using wrong.

This is how it is used, I do not understand!
 Quote:

$tree.nodes(1).SelectedNode


Edited by AndreLuiz (2017-10-06 10:09 AM)

Top
#212714 - 2017-10-06 05:07 PM Re: [Kixforms-Classic TreeView] SelectedNode [Re: AndreLuiz]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
Olá Andre,

questions first:
- How many branches does your tree have?
- Do you want to get or set .SelectedNode?
_________________________



Top
#212718 - 2017-10-06 09:57 PM Re: [Kixforms-Classic TreeView] SelectedNode [Re: Jochen]
AndreLuiz Offline
Getting the hang of it

Registered: 2015-10-07
Posts: 71
Loc: Brasil, João pessoa
[PTBR]
A minha árvore não possuí subárvores.
e eu quero definir eu quero que um dos nós sejam selecionados.
Você me entende?

[ENG]
My tree has no subtrees.
and I want to define I want one of the nodes to be selected.
You understand me?

Ex:
$tree.Nodes(0).text = 'ola'
$tree.Nodes(1).text = 'ola1'
$tree.Nodes(2).text = 'ola2'
$tree.Nodes(3).text = 'ola3'

$tree.Nodes(2).selectedNode

[PTBR]
Dá para entender com este exemplo o que quero fazer?

Obrigado desde já! \:D

[ENG]
Can you understand by this example what I want to do?

Thank you in advance! : D

Top
#212720 - 2017-10-06 10:23 PM Re: [Kixforms-Classic TreeView] SelectedNode [Re: AndreLuiz]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
Ja,
I understand perfectly now \:D

you want to do this then:

 Code:

$tree = $system.TreeView ;or, if you use the form as parent: $tree = $form.TreeView

$tree.Nodes.Add('ola')
$tree.Nodes.Add('ola1')
$tree.Nodes.Add('ola2')
$tree.Nodes.Add('ola3')

$tree.SelectedNode = 2



If you don't have it already, I recomend you keep this little helper with you:
http://www.kixforms.org/assets/files/kixforms/KiXforms_246.chm

hth
_________________________



Top
#212723 - 2017-10-07 07:12 AM Re: [Kixforms-Classic TreeView] SelectedNode [Re: Jochen]
AndreLuiz Offline
Getting the hang of it

Registered: 2015-10-07
Posts: 71
Loc: Brasil, João pessoa
[PTBR]
Olá, ainda não funcionou, veja só:

[ENG]
Hello, it still did not work, see:

 Code:
Break on
$system = createObject('kixtart.system')
$form	= $system.Form()
$tree = $form.TreeView ;or, if you use the form as parent: $tree = $form.TreeView

$=$tree.Nodes.Add('ola')
$=$tree.Nodes.Add('ola1')
$=$tree.Nodes.Add('ola2')
$=$tree.Nodes.Add('ola3')

$form.Show
while $form.visible
	$tree.SelectedIndex = 2
	$tree.SelectedNode.index?
	$=Execute($form.DoEvents(1))
loop



[PTBR]
Ele deveria ter selecionado o "ola2", e não foi isso que ele fez, ele não seleciona nada, na verdade.

[ENG]
He should have selected the "hello2", and that's not what he did, he does not select anything, actually.

Top
#212724 - 2017-10-07 11:45 AM Re: [Kixforms-Classic TreeView] SelectedNode [Re: AndreLuiz]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
My Bad,

have made one mistake (don't use Kixtart.System object for .Form objects) and a wrong assumption.. >The value of SelectedNode is of course an object not an index

My only excuse is my long put to rest kixforms kung fu
this works as requested:

 Code:
Break on
$system = createObject('kixtart.system')
$form	= $system.Form()
$tree = $form.TreeView

$0=$tree.Nodes.Add('ola')
$1=$tree.Nodes.Add('ola1')
$2=$tree.Nodes.Add('ola2')
$3=$tree.Nodes.Add('ola3')

$tree.SelectedNode = $2

$form.Show
while $form.visible
	$=Execute($form.DoEvents(1))
loop
_________________________



Top
#212742 - 2017-10-12 12:52 AM Re: [Kixforms-Classic TreeView] SelectedNode [Re: Jochen]
AndreLuiz Offline
Getting the hang of it

Registered: 2015-10-07
Posts: 71
Loc: Brasil, João pessoa
[PTBR]
Obrigado!!!

Assim também funciona.

[ENG]
Thank you!!!

So does it work.
 Code:
Break on
$system = createObject('kixtart.system')
$form	= $system.Form()
$tree = $form.TreeView

$=$tree.Nodes.Add('ola')
$=$tree.Nodes.Add('ola1')
$=$tree.Nodes.Add('ola2')
$=$tree.Nodes.Add('ola3')

$tree.SelectedNode = $tree.Nodes(2)

$form.Show
while $form.visible
	$=Execute($form.DoEvents(1))
loop

Top
#212743 - 2017-10-12 10:01 AM Re: [Kixforms-Classic TreeView] SelectedNode [Re: AndreLuiz]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
thats even the better approach \:\)
_________________________



Top
Page 1 of 1 1


Moderator:  ShaneEP, Mart, Radimus, Jochen, Allen, Glenn Barnas 
Hop to:
Shout Box

Who's Online
3 registered (fergieman101, Glenn Barnas, Mart) and 183 anonymous users online.
Newest Members
emnipetro, Hirze, thequeen, ameliaryan, shalomsalami
17641 Registered Users

Generated in 0.034 seconds in which 0.01 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org