[color="red"]Eu pra variar... to aqui de novo :P
Dessa vez é o seguinte: preciso fechar uma janela quando selecionar uma linha do grid dentro dela, além de retornar o valor para o edittex da tela anterior...
já consegui retornar o valor... mas n sei onde colocar o mydialog.close();
:razz:
Beijocas!!! [/color]
<?xml version="1.0" encoding="ISO-8859-1" ?>
<canvas height="600" width="1100" bgcolor="#C1CDC1">
<greenstyle name="specialstyle"/>
<dataset name="dsSendData" request="false" src="http://10.96.168.4/usuarios_pesq.php"/>
<class name="contactview" extends="view" visible="true" x="20" height="120">
<!-- 2 -->
<text name="pk" visible="false" datapath="@cod_pessoa"/>
<text fontstyle="bold" x="45" y="30">Usuário:</text>
<edittext width="300" x="111" y="25" name="nome_pesq" datapath="@nome_pesq" />
<method name="sendData" args="action">
var d=canvas.datasets.dsSendData; // 3
var p=new LzParam(); // 3a
p.addValue("action", action, true);
p.addValue("pk", pk.getText(), true);
p.addValue("nome_pesq", nome_pesq.getText(), true);
d.setQueryString(p); // 3c
d.doRequest(); // 3d
</method>
<!-- 4 -->
</class>
<class name="box" height="50" width="650" bgcolor="#838B83" x="10" y="10"/>
<class name="borderedbox" extends="box">
<attribute name="bordersize" value="3"/>
<view bgcolor="#F8F8FF"
x="${parent.bordersize}"
y="${parent.bordersize}"
width="${parent.width - parent.bordersize*2 }"
height="${parent.height - parent.bordersize*2 }"/>
</class>
<dataset name="contacts" request="true" src="http://10.96.168.4/usuarios.php"/>
<modaldialog name="mydialog" width="600" height="400"
title="Pesquisa de Usuários" bgcolor="#DCDCDC" closeable="true">
<borderedbox bordersize="3" width="530"/>
<view>
<!-- <text onclick="parent.newContact.setVisible(!parent.newContact.visible);">New Entry...</text> -->
<contactview name="newContact" datapath="new:/contact">
<button width="85" y="25" x="420">Pesquisa
<view x="6" bgcolor="green" height="10" width="10" valign="middle"/>
<handler name="onclick">
parent.sendData("search"); // 5
parent.datapath.updateData();
var dp=canvas.datasets.dset.getPointer();
dp.selectChild();
dp.addNodeFromPointer( parent.datapath );
parent.setDatapath("new:/contact");
</handler>
</button>
</contactview>
</view>
<button id="left6" style="{basecolor:0xbbbbff}" text="Limpar" width="100" y="70" x="220"/>
<grid
name="tabelaContatos"
shownitems="7"
datapath="dsSendData:/resultset"
height="150"
y="120" x="10"
styleable="specialstyle"
>
<gridcolumn width="80" text="Código">
<text datapath="@cod_pessoa" onclick="details.datapath.setPointer(this.datapath.p)"/>
</gridcolumn>
<gridcolumn width="190" text="Nome">
<text datapath="@nome_pessoa" onclick = "details.datapath.setPointer(this.datapath.p)" />
</gridcolumn>
<gridcolumn width="190" text="Setor">
<text datapath="@setor" onclick = "details.datapath.setPointer(this.datapath.p)"/>
</gridcolumn>
<gridcolumn width="70" text="Ramal">
<text datapath="@ramal" onclick = "details.datapath.setPointer(this.datapath.p)"/>
</gridcolumn>
<!-- trata o evento de seleção -->
</grid>
</modaldialog>
<button onclick="canvas.mydialog.open()">Open Dialog</button>
<view id="details" width="150" height="150" >
<datapath/>
<edittext name="cod" visible="true" x="111" y="50" datapath="@cod_pessoa"/>
<text fontstyle="bold" x="45" y="30">nome:</text>
<edittext width="300" x="111" y="25" name="nome" visible="true" datapath="@nome_pessoa"/>
</view>
</canvas>
