View Full Version : Ext.Editor does not call onBlur function correctly

Tyler Cook
23 Jul 2010, 7:45 AM
I am in the process of updating some aspx pages that use a previous version of Ext to Ext 3.2.1. Most of the changes are straightforward but I'm having trouble with the editor control. On the previous version the editors in my pages work fine (e.g. - I have a label you click on and the editor opens, you make changes to a textfield or datefield or whatever control is in the editor, then you hit enter or click anywhere outside the textfield and the editor completes the edit by inserting the new value and hiding the editor textfield by going back to a label). This is the standard function of the editor control but after moving to Ext 3.2.1 the editor freezes in the edit state. Only hitting enter will complete the edit. I checked out the code and see that in the onRender handler a listener is added for the onBlur event and a onBlur handler that uses a if statement to determine whether to call the completeEdit handler or not depending on this expression: (this.allowBlur === true && this.editing && this.selectSameEditor !== true). I know that from testing that allowBlur and editing are true but I don't know about selectSameEditor. Anyway is this even my problem or did I miss a setting some where? Any help is much appreciated!

25 Jul 2010, 6:29 AM
Could you post the code you have now?

Tyler Cook
25 Jul 2010, 7:03 AM
Most of my pages are 600+ lines of code so here is a simple example that does not work correctly on my system:

<%@Page Language="VB" %>

<%@Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE htmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htm lxmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
<title>Untitled Page</title>

<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server"></ext:ResourceManager>

<h1>Inline Editor Test</h1><br/><br/>

<ext:Label ID="Label1" runat="server" Text="Click here to edit this text.">
<ext:Editor runat="server">
<ext:TextField runat="server"></ext:TextField>


Sample pic of this code running and how
it sticks in the edit mode even when clicking outside the editor
it still does not call the complete event:


Thanks for any help you can give!

25 Jul 2010, 7:57 AM
You are using an Ext.Net library that I know nothing about.

Do you have the actual javascript code that is used to create the editor?

Tyler Cook
25 Jul 2010, 8:17 AM
Here is the script code added to the page by the Ext resource manager:

<script type="text/javascript" src="/QEITWEB/extjs/adapter/ext/ext-base-js/ext.axd?v=34580"></script>
<script type="text/javascript" src="/QEITWEB/extjs/ext-all-js/ext.axd?v=34580"></script>
<script type="text/javascript" src="/QEITWEB/extnet/extnet-core-js/ext.axd?v=34580"></script>
<script type="text/javascript">
Ext.onReady(function(){Ext.QuickTips.init();new Ext.form.Label({id:"Label1",renderTo:"Label1_Container",text:"Click here to edit this text.",editor:{id:"ctl02",xtype:"editor",cancelOnEsc:true,completeOnEnter:true,updateEl:true,field:{id:"ctl03",xtype:"textfield"},isSeparate:true}});});Ext.net.ResourceMgr.init({id:"ResourceManager1",BLANK_IMAGE_URL:"/QEITWEB/extjs/resources/images/default/s-gif/ext.axd",aspForm:"form1"});

The script links are to the stanard ExtJS Libraries ext-base.js and ext-all.js. The script link to extnet-core.js is simply an adapted verison of ext-core.js for .net so that all the javascript can be bundled into a dll assembly. The rest is the javascript for the ext controls on the page.

Thanks for tring to help me!

25 Jul 2010, 9:44 AM
That doesn't help much, because that is still not a standard Ext.form.Label from the SDK.