Sep 12, 2017, 11:33 AM
DateMenu does not work when an ID is specified
Ext.Net version: 4.4.0
Hello,
The DateMenu component does not work when it has an ID. We discovered this issue when upgrading from 4.2.2 to 4.4.0. This page demonstrates the issue:
Changing the ResourceManager ScriptMode to "Debug" logs "[E] Ext.ComponentManager.register(): Duplicate component id "TestMenu"" instead.
I believe the issue is that the Ext.Js Ext.menu.DatePicker class expects a "pickerCfg" config option, but Ext.Net provides a "pickerConfig" option instead. This in turn causes the Ext.picker.Date component to have the same ID as the Ext.menu.DatePicker.
We currently use the following override as a workaround:
Raphael
Hello,
The DateMenu component does not work when it has an ID. We discovered this issue when upgrading from 4.2.2 to 4.4.0. This page demonstrates the issue:
<%@ Page Language="C#" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager runat="server" />
<ext:Button runat="server" Text="Button with DateMenu">
<Menu>
<ext:DateMenu runat="server" ID="TestMenu" />
</Menu>
</ext:Button>
</form>
</body>
</html>
When the button is clicked, nothing happens and the following error is logged in the chrome console: "Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The new child element contains the parent.". Firefox shows a slightly different error, but the effect is the same.Changing the ResourceManager ScriptMode to "Debug" logs "[E] Ext.ComponentManager.register(): Duplicate component id "TestMenu"" instead.
I believe the issue is that the Ext.Js Ext.menu.DatePicker class expects a "pickerCfg" config option, but Ext.Net provides a "pickerConfig" option instead. This in turn causes the Ext.picker.Date component to have the same ID as the Ext.menu.DatePicker.
We currently use the following override as a workaround:
Ext.define(null, {
override: "Ext.menu.DatePicker",
initComponent: function () {
this.pickerCfg = this.pickerCfg || this.pickerConfig;
this.callParent(arguments);
}
});
Best regards,Raphael