Jun 27, 2013, 3:25 PM
[CLOSED] DateField range with MasterPage
Hi Support team,
I try to implement a date range with datefield on page which includes one master page.
I followed an example code but I found it didn't work with master page environment because asp.net change clientID automatically.
It displayed an error message on daterange function on Vtype.js.
I attached a captured images.
https://examples2.ext.net/#/Form/Dat...From-To_Range/
Regards,
Kevin
I try to implement a date range with datefield on page which includes one master page.
I followed an example code but I found it didn't work with master page environment because asp.net change clientID automatically.
It displayed an error message on daterange function on Vtype.js.
I attached a captured images.
https://examples2.ext.net/#/Form/Dat...From-To_Range/
<script type="text/javascript">
var onKeyUp = function () {
var me = this,
v = me.getValue(),
field;
if (me.startDateField) {
field = Ext.getCmp('<%= dtStartDate.ClientID %>');
field.setMaxValue(v);
me.dateRangeMax = v;
} else if (me.endDateField) {
field = Ext.getCmp('<%= dtEndtDate.ClientID %>');
field.setMinValue(v);
me.dateRangeMin = v;
}
field.validate();
};
</script>
== ASPX page
<ext:DateField ID="dtStartDate" runat="server" FieldLabel="Start Date" Width="400" EnableKeyEvents="true" Vtype="daterange">
<CustomConfig>
<ext:ConfigItem Name="endDateField" Value="dtEndDate" Mode="Value" />
</CustomConfig>
<Listeners>
<KeyUp Fn="onKeyUp" />
</Listeners>
</ext:DateField>
<ext:DateField ID="dtEndDate" runat="server" FieldLabel="End Date" Width="400" EnableKeyEvents="true" Vtype="daterange">
<CustomConfig>
<ext:ConfigItem Name="startDateField" Value="dtStartDate" Mode="Value" />
</CustomConfig>
<Listeners>
<KeyUp Fn="onKeyUp" />
</Listeners>
</ext:DateField>
Regards,
Kevin
Last edited by Baidaly; Jun 28, 2013 at 5:23 PM.
Reason: [CLOSED]