PDA

View Full Version : [CLOSED] [2.2+] Uncaught TypeError when Showing Window with DatePicker after DirectEvent set DisabledDatesRE



michaeld
May 29, 2013, 10:30 AM
Uncaught TypeError: Object new RegExp('^(?!^(^6\/9\/2013)|(^7\/14\/2013)|(^8\/11\/2013)|(^9\/8\/2013)|(^10\/13\/2013)|(^11\/10\/2013)|(^12\/8\/2013)|(^1\/12\/2014)|(^2\/9\/2014)|(^3\/9\/2014)|(^4\/13\/2014)|(^5\/11\/2014)|(^6\/8\/2014)|(^7\/13\/2014)|(^8\/10\/2014)|(^9\/14\/2014)|(^10\/12\/2014)|(^11\/9\/2014)|(^12\/14\/2014)|(^1\/11\/2015)|(^2\/8\/2015)|(^3\/8\/2015)|(^4\/12\/2015)|(^5\/10\/2015)|(^6\/14\/2015)|(^7\/12\/2015)|(^8\/9\/2015)|(^9\/13\/2015)|(^10\/11\/2015)|(^11\/8\/2015)|(^12\/13\/2015)|(^1\/10\/2016)|(^2\/14\/2016)|(^3\/13\/2016)|(^4\/10\/2016)|(^5\/8\/2016)|(^6\/12\/2016)|(^7\/10\/2016)|(^8\/14\/2016)|(^9\/11\/2016)|(^10\/9\/2016)|(^11\/13\/2016)|(^12\/11\/2016)|(^1\/8\/2017)|(^2\/12\/2017)|(^3\/12\/2017)|(^4\/9\/2017)|(^5\/14\/2017)|(^6\/11\/2017)|(^7\/9\/2017)|(^8\/13\/2017)|(^9\/10\/2017)|(^10\/8\/2017)|(^11\/12\/2017)|(^12\/10\/2017)|(^1\/14\/2018)|(^2\/11\/2018)|(^3\/11\/2018)|(^4\/8\/2018)|(^5\/13\/2018)|(^6\/10\/2018)$).*$') has no method 'test'

in Ext.define.fullUpdate

whenDates.DisabledDatesRE set in DirectEvent followed by DateW.Show();



<ext:Window ID="DateW" runat="server" CloseAction="Hide" Title="Preview" Hidden="true" Resizable="false">
<Items>
<ext:DatePicker ID="Dates" runat="server" />
</Items>
</ext:Window>

michaeld
May 29, 2013, 10:33 AM
p.s. I searched for DatePicker in the examples explorer and found nothing. Thought I'd note this.

Daniil
May 29, 2013, 1:02 PM
Hi @michaeld,

Could you, please, provide a full test case?

michaeld
May 30, 2013, 8:57 AM
<%@ Page Language="C#" %>


<script runat="server">
protected void Page_Load( object sender, EventArgs e ) {
}
protected void OnPreview( object sender, DirectEventArgs e ) {
Dates.DisabledDatesRE = @"new RegExp('^(?!^(^6\/2\/2013)|(^4\/26\/2015)$).*$')";
DateW.Show();
}
</script>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="//www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
</head>
<body>
<form id="f" runat="server">




<ext:Viewport ID="vp" runat="server" Layout="VBoxLayout">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>


<ext:FormPanel runat="server" Width="400" Border="false">
<Bin>


<ext:Window ID="DateW" runat="server" CloseAction="Hide" Title="Preview of Next 100 Dates" Hidden="true" Resizable="false">
<Items>
<ext:DatePicker ID="Dates" runat="server" />
</Items>
</ext:Window>


</Bin>
<Content>
Test...
</Content>
<Buttons>


<ext:Button id="Preview" runat="server" Type="Button" Text="Preview Dates">
<DirectEvents>
<Click OnEvent="OnPreview">
<EventMask ShowMask="true" MinDelay="500" Msg="Getting Dates..." />
</Click>
</DirectEvents>
</ext:Button>


</Buttons>
</ext:FormPanel>


</Items>
</ext:ViewPort>


<ext:ResourceManager ID="rm" runat="server" CleanResourceUrl="true" ScriptMode="Development" InitScriptMode="Linked"
HideInDesign="true" GZip="true" />
</form>
</body>
</html>

Daniil
May 30, 2013, 1:36 PM
Thank you. Fixed in SVN.

But please do not use "new RegExp()". Just a raw string of a regular expression.