PDA

View Full Version : Problem with event control EXT. Please help me. Serious.



maychu123
18 Aug 2011, 7:47 PM
I have a text box and event change for it. I have a button find and event click find for button. When i input it textbox and click button. It only run event change of text box. It not running event of button. I want it run event change of text box then run event of button. How do i must do. please help me and thanks.

skirtle
18 Aug 2011, 8:28 PM
There's probably a typo in your code, what you describe should work fine.

If you need help finding the problem then please post the code you use to register the click listener. Make sure you wrap any code in code tags (# button on the editor toolbar). Incidentally, usually people use the handler config option instead of a click listener but it should work either way.

maychu123
18 Aug 2011, 11:27 PM
<ext:XScript ID="XScript1" runat="server">

<script type="text/javascript">

function Search() {


CMS.ShowMask();
#{DirectMethods}.SearchAddress();
}

function FindEntity()
{
if(#{txtEntityCode}.getValue().trim() != ''){
#{DirectMethods}.GetInsuranceCode()
}
else{#{txtEntityName}.setValue('');SetMenu(false);}

}
function SetMenu(type)
{


</script>
</ext:XScript>
<ext:TextField ID="txtEntityCode" EmptyText="Number" runat="server" MaxLength="10"
Width="120" EmptyClass="hint">
<ToolTips>
<ext:ToolTip runat="server" Html="Entity Number">
</ext:ToolTip>
</ToolTips>
<Listeners>
<Change Handler="FindEntity();" />
</Listeners>
</ext:TextField>
<ext:Button ID="btnFind" runat="server" Text="Find" Width="50">
<Listeners>
<Click Handler=" Search();" />
</Listeners>
</ext:Button>

This is my code. When i input text for txtEntityCode and click button find only FindEntity() occur . Search() not running.

skirtle
19 Aug 2011, 9:47 AM
Please can you post the JavaScript code? It must be JS by the time it reaches the browser...

Also, as I mentioned in my original post, please wrap all code in code tags.

maychu123
21 Aug 2011, 8:28 PM
i can not post code JScript. My client computer does not allow view script. Can you support me.

skirtle
21 Aug 2011, 8:53 PM
i can not post code JScript. My client computer does not allow view script. Can you support me.

ExtJS is a JavaScript framework. If you can't show me the JavaScript you're using I can't even attempt to fix it for you.