I did find issue that was created when my code example was cut&pasted. Besides that issue, I don't know what to say except that the blur function is called first when I use the date control and that sets "focused" to false. If "focused" is false then focus is not moved to button2, and therefore goes to button1 on the parent page.
In your steps you say that focus "moves on top". On top of what? When shift+tab is pressed, when on the datefield, focus should move to the "some button" button (button2). In my environment, it moves to button1 on the parent page. I am perplexed at how your focus behavior could differ from mine.
Here is the corrected code:
@ Page Language="VB" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ext.Net Example</title>
<script type="text/javascript">
var onFocus = function (e, t, o) {
this.focused = true;
}
var onBlur = function (e, t, o) {
this.focused = false;
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:KeyMap ID="KeyMap1" runat="server" Target="={Ext.isGecko ? Ext.getDoc() : Ext.getBody()}">
<ext:KeyBinding>
<Keys>
<ext:Key Code="TAB"/>
</Keys>
<Listeners>
<Event Handler="if (!e.shiftKey) {
if (Button2.focused) {
e.stopEvent();
DateField1.focus();
}
} else {
if (DateField1.focused) {
e.stopEvent();
Button2.focus();
}
}" />
</Listeners>
</ext:KeyBinding>
</ext:KeyMap>
<ext:Button ID="Button1" runat="server" Text="Show window">
<Listeners>
<Click Handler="Window1.show();" />
</Listeners>
</ext:Button>
<ext:Window
ID="Window1"
runat="server"
Modal="true"
Height="300"
Hidden="true">
<Items>
<ext:DateField ID="DateField1" runat="server">
<Listeners>
<Blur Fn="onBlur" />
<Focus Fn="onFocus" />
</Listeners>
</ext:DateField>
<ext:TextField ID="TextField1" runat="server" />
<ext:TextField ID="TextField2" runat="server" />
</Items>
<Buttons>
<ext:Button ID="Button2" runat="server" Text="Some buttom">
<Listeners>
<AfterRender Handler="this.btnEl.on('focus', onFocus, this);
this.btnEl.on('blur', onBlur, this);" />
<Click Handler="alert('Hello!');" />
</Listeners>
</ext:Button>
</Buttons>
<Listeners>
<Show Handler="DateField1.focus();" Delay="100" />
</Listeners>
</ext:Window>
</form>
</body>
</html>