DateField's DisabledDate doesn't work in Ajax Event

  1. #1

    DateField's DisabledDate doesn't work in Ajax Event

    <table cellspacing="10px" style="margin:10 10 10 10; width:390px">
                        <tr>
                            <td align="right">
                                <ext:Label ID="Label1" runat="server" Text="Select User : "></ext:Label>
                            </td>
                            <td><font color="#FF0000">*</font></td>
                            <td align="left">
                                <ext:ComboBox ID="NewLeaveUser" runat="server" Editable="false" StoreID="ROSUserStore" EmptyText="Select User" DisplayField="UserFullName" ValueField="Uid">
                                  <AjaxEvents>
                                    <Select OnEvent="NewLeaveUser_Change"></Select>
                                  </AjaxEvents>  
                                </ext:ComboBox>
                            </td>
                            
                        </tr>
                        <tr>
                            <td align="right">
                                <ext:Label ID="Label2" runat="server" Text="Leave Start Date : "></ext:Label>
                                
                            </td>
                            <td><font color="#FF0000">*</font></td>
                           <td align="left">
                                <ext:DateField ID="NewStartDate" runat="server" Format="dd/MM/yyyy" Vtype="daterange" EnableViewState="false">
                                <CustomConfig>
                                    <ext:ConfigItem Name="endDateField" Value="#{NewEndDate}" Mode="Value" />
                                </CustomConfig>
                                </ext:DateField>
                                
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <ext:Label ID="Label3" runat="server" Text="Leave End Date : "></ext:Label>
                            </td>
                            <td><font color="#FF0000">*</font></td>
                           <td align="left">
                                <ext:DateField ID="NewEndDate" runat="server" Format="dd/MM/yyyy" EnableViewState="false">
                                <%--<CustomConfig>
                                    <ext:ConfigItem Name="startDateField" Value="#{NewStartDate}" Mode="Value" />
                                </CustomConfig>--%> 
                                </ext:DateField>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <ext:Label ID="Label4" runat="server" Text="Covering Officer : "></ext:Label>
                            </td>
                            <td><font color="#FF0000">*</font></td>
                            <td align="left">
                                <ext:ComboBox ID="NewCoveringUser" runat="server" Editable="false"  StoreID="ROSUserStore1" EmptyText="Select User" DisplayField="UserFullName" ValueField="Uid"></ext:ComboBox>
                            </td>
                        </tr>
                        
                    </table>
    protected void NewLeaveUser_Change(object sender, AjaxEventArgs e)
            {
                DisabledDate disabledDate=new DisabledDate(2010,11,20);
                this.NewStartDate.DisabledDates.Add(disabledDate);
                
                this.NewCoveringUser.Enabled = true;
                this.NewCoveringUser.SelectedItem.Value = "Select User";
                string newLeaveUserUid = this.NewLeaveUser.SelectedItem.Value;
                this.BindCoveringOfficer(newLeaveUserUid);
    
    
            }
    It doesn't work, the date doesn't disabled after NewLeaveUser_Change called.
  2. #2
    Hi,

    Updating DisabledDates during an AjaxEvent within the v0.8.x release is not supported. Upgrading to v1.0 may solve this problem.
    Geoffrey McGill
    Founder
  3. #3
    Quote Originally Posted by geoffrey.mcgill View Post
    Hi,

    Updating DisabledDates during an AjaxEvent within the v0.8.x release is not supported. Upgrading to v1.0 may solve this problem.
    unfortunately, our company's project using 0.8
    any other method to solve this problem?
  4. #4
    Hi,

    Please call 'UpdateDisabledDates' during AjaxEvent after modifing DisabledDates
  5. #5
    Hi,

    If that method is absent in your version then use
    DateField1.AddScript("{0}.setDisabledDates({1});", DateField1.ClientID, DateField1.DisabledDates.ToString());
  6. #6
    Quote Originally Posted by Vladimir View Post
    Hi,

    Please call 'UpdateDisabledDates' during AjaxEvent after modifing DisabledDates

    I think geoffrey.mcgill was answer the question, UpdateDisabledDates is not support in coolite 0.8x.
    Our company using 0.8, so...:(
  7. #7
    Quote Originally Posted by Vladimir View Post
    Hi,

    If that method is absent in your version then use
    DateField1.AddScript("{0}.setDisabledDates({1});", DateField1.ClientID, DateField1.DisabledDates.ToString());

    I add in the code:

    protected void NewLeaveUser_Change(object sender, AjaxEventArgs e)
            {
                DisabledDate disabledDate = new DisabledDate(2010, 11, 20);
                this.NewStartDate.DisabledDates.Add(disabledDate);
                NewStartDate.AddScript("{0}.setDisabledDates({1});", NewStartDate.ClientID, NewStartDate.DisabledDates.ToString());
                this.NewCoveringUser.Enabled = true;
                this.NewCoveringUser.SelectedItem.Value = "Select User";
                string newLeaveUserUid = this.NewLeaveUser.SelectedItem.Value;
                this.BindCoveringOfficer(newLeaveUserUid);
    
                
            }
    still doesn't work...
    Last edited by geoffrey.mcgill; Nov 10, 2010 at 3:54 PM. Reason: please use [CODE] tags

Similar Threads

  1. Northwind example doesn't work in IE9
    By Const in forum 1.x Help
    Replies: 10
    Last Post: Dec 09, 2011, 3:04 AM
  2. [1.0RC]MultiHeader doesn't work.
    By firebank in forum 1.x Help
    Replies: 1
    Last Post: Nov 11, 2010, 4:06 PM
  3. Replies: 8
    Last Post: Aug 17, 2009, 7:44 PM
  4. Keymap doesn't work
    By Kamal in forum 1.x Help
    Replies: 2
    Last Post: Aug 13, 2009, 10:49 AM
  5. Event Mask doesn't work!!
    By mono in forum 1.x Help
    Replies: 7
    Last Post: Mar 10, 2009, 7:07 AM

Tags for this Thread

Posting Permissions