Dynamically createing the ext:net control

Page 1 of 2 12 LastLast
  1. #1

    Dynamically createing the ext:net control

    ext:EventEditWindow how to create controls dynamically in EventEditWindow in below my code.pls help me soon............

    <ext:EventEditWindow Title="Add Event" ID="EventEditWindow1" RegisterAllResources="true" AutoScroll="true" Border="false" Cls="fixpanelpadding" Resizable="true" runat="server" Hidden="true" GroupStoreID="GroupStore1">
            <Items>
            <ext:FormPanel runat="server" HideLabels="true"  Border="false" ID="frmPnl">        
            <Content> 
               
             <ext:CompositeField runat="server" HideLabels="true">         
            <Items>
             <ext:DateField ID="txtStartDate" Flex="1" runat="server" Note="Start Date" NoteAlign="Top" EnableKeyEvents="true" Format="MM-dd-yyyy" >         
             </ext:DateField>        
             <ext:TimeField Flex="1" runat="server" ID="ddlstartTime"  Note="Start Time" NoteAlign="Top" MinTime="1:00" MaxTime="23:45" Increment="15"  Format="H:mm" > </ext:TimeField>
             <ext:Label ID="Label1" runat="server" Cls="x-label-value" StyleSpec="padding-top:16px;" Html="<span>to</span>" />
             <ext:TimeField Flex="1" runat="server" ID="ddlEndTime"  Note="End Time" NoteAlign="Top" MinTime="1:00" MaxTime="23:45" Increment="15" Format="H:mm" ></ext:TimeField>
             <ext:DateField  Flex="1" ID="txtEndDate" runat="server" Note="End Date" NoteAlign="Top" EnableKeyEvents="true" Format="MM-dd-yyyy">
             </ext:DateField>                    
             <ext:Checkbox Flex="1" BoxLabel="All day" StyleSpec="margin-top:18px" runat="server" ID="ChkAllday">     
             <Listeners>
                 <Check Handler="if (checked) {#{ddlstartTime}.setDisabled(true);#{ddlEndTime}.setDisabled(true);} else{#{ddlstartTime}.setDisabled(false);#{ddlEndTime}.setDisabled(false);}"/>
             </Listeners>      
             </ext:Checkbox>         
             </Items>
             </ext:CompositeField>
             <ext:CompositeField runat="server" AnchorHorizontal="100%" HideLabels="true">
             <Items>
             <ext:ComboBox Flex="1" runat="server" ID="ddlPredefinedOccuranceCode" Note="Predefined Reasons" NoteAlign="Top" StoreID="storeOccurence" DisplayField="OccuranceCode" ValueField="OccuranceCodeID" BlankText="-Select-"></ext:ComboBox>
             </Items>
             </ext:CompositeField>
              <ext:CompositeField ID="CompositeField1" runat="server" AnchorHorizontal="100%" HideLabels="true">
             <Items>
             <ext:TextField Flex="1" runat="server" Note="Reason" NoteAlign="Top" ></ext:TextField>
             
             </Items>
             </ext:CompositeField>
              <ext:CompositeField ID="CompositeField2" runat="server" AnchorHorizontal="100%" HideLabels="false">
             <Items>
             <ext:RadioGroup ID="RadioGroup3" 
                runat="server" HideLabel="false" 
                FieldLabel="Multi-Column<br/>(Horizontal)" Note="Appointment Status" NoteAlign="Top"  GroupName="Appointment"
                ColumnsNumber="3">
                <Items>
                    <ext:Radio ID="rbtCheckedIn" runat="server" BoxLabel="Checked In" InputValue="7"/>
                    <ext:Radio ID="rbtNoShow" runat="server" BoxLabel="No Show"  InputValue="6"/>
                    <ext:Radio ID="rbtWatingInRoom" runat="server" BoxLabel="Wating In Room" InputValue="5"/> 
                    <ext:Radio ID="rbtCancelled" runat="server" BoxLabel="Cancelled" InputValue="4"/>
                    <ext:Radio ID="rbtCheckedOut" runat="server" BoxLabel="Checked Out" InputValue="3"/>
                    <ext:Radio ID="rbtReScheduled" runat="server" BoxLabel="Rescheduled" InputValue="2" />
                    <ext:Radio ID="rbtScheduled" runat="server" BoxLabel="Scheduled"  Checked="true" InputValue="1"/>                               
                </Items>
            </ext:RadioGroup> 
             
             </Items>
             </ext:CompositeField>
             </Content>
             </ext:FormPanel>
            </Items>
          <%--      <Listeners>
                    <EventAdd Fn="sam" Scope="KnackSchedule" />
                    <EventUpdate Fn="KnackSchedule.record.update" Scope="KnackSchedule" />
                    <EditDetails Fn="KnackSchedule.record.edit" Scope="KnackSchedule" />
                    <EventDelete Fn="KnackSchedule.record.remove" Scope="KnackSchedule" />
                </Listeners>--%>
                <%--<Listeners>
                <EventAdd Handler="KnackSchedule.SaveData();"/>
                </Listeners>--%>
                <%--<DirectEvents>
                <EventAdd OnEvent="AddData"/>
                </DirectEvents>--%>
                  <%--<Listeners>
                <EventAdd  Handler="KnackSchedule.SaveData();" />
                </Listeners>--%>
            </ext:EventEditWindow>
    Last edited by Daniil; Dec 17, 2010 at 1:31 PM. Reason: Please use [CODE] tags
  2. #2

    Help me

    Pls help me as soon as posiibble.......
  3. #3
  4. #4
    Hi again me,

    I want save Button server event it is possible or not .if its not but how to create the server event in EventEditWindow.In this window i want creating my own Ext.Net control.how to create the own control please give me example(like textfield,combox,checkbox).

    pls let me....
  5. #5
    Quote Originally Posted by krishna View Post
    Hi again me,
    I want save Button server event it is possible or not .if its not but how to create the server event in EventEditWindow.
    Hi,

    Please use <DirectEvents>.

    Example
    <ext:CalendarPanel ...>
        ...
        <DirectEvents>
            <DayClick OnEvent="DayClick_Handler" />
        </DirectEvents>
    </ext:CalendarPanel>
  6. #6
    Quote Originally Posted by krishna View Post
    creating my own Ext.Net control.how to create the own control please give me example(like textfield,combox,checkbox).
    Custom EventEditWindow is not supported.

    Well, I can suggest you the following trick to achieve your requirement.

    Example
    <%@ Page Language="C#" %>
     
    <%@ 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 runat="server">
        <title>Ext.Net Example</title>
     
        <script type="text/javascript">
            var CompanyX = {
                getWindow: function() {
                    return CompanyX.EventEditWindow1;
                },
    
                dayClick: function(cal, dt, allDay, el) {
                    this.record.show.call(this, cal, {
                        StartDate: dt,
                        IsAllDay: allDay
                    }, el);
                },
    
                record: {
                    show: function(cal, rec, el) {
                        CompanyX.getWindow().show(rec, el);
                    }
                }
            };
        </script>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" Namespace="CompanyX" />
        <ext:Viewport runat="server" Layout="fit">
            <Items>
                <ext:CalendarPanel ID="CalendarPanel1" runat="server" Height="500">
                    <EventStore runat="server">
                        <Events>
                            <ext:Event Title="My event" StartDate="2010/10/13" EndDate="2010/10/13" />
                        </Events>
                    </EventStore>
                    <GroupStore ID="GroupStore1" runat="server">
                        <Groups>
                            <ext:Group CalendarId="1" Title="Home" />
                            <ext:Group CalendarId="2" Title="Work" />
                            <ext:Group CalendarId="3" Title="School" />
                            <ext:Group CalendarId="4" Title="Other" />
                        </Groups>
                    </GroupStore>
                    <Listeners>
                        <DayClick Fn="CompanyX.dayClick" Scope="CompanyX" />
                    </Listeners>
                </ext:CalendarPanel>
            </Items>
        </ext:Viewport>
        <ext:EventEditWindow
            ID="EventEditWindow1"
            runat="server"
            Hidden="true"
            GroupStoreID="GroupStore1">
            <Listeners>
                <BeforeRender Handler="this.formPanel.items.each(function(item){item.hidden = true;});" />
                <Render Handler="this.formPanel.add({id: 'TextField1', fieldLabel: 'TextField1', xtype:'textfield'});" />
            </Listeners>
        </ext:EventEditWindow>
        </form>
    </body>
    </html>
    Last edited by Daniil; Dec 21, 2010 at 2:55 PM.
  7. #7
    Hi again me,

    Above the code really help full me .But how to Create the combobox and Radiogroup buttons in Render Event.give me the example code of both.
    pls let me as soon as possible....
  8. #8
    Hi,

    Well, I can suggest you the following thing.

    1. Create markup .aspx to get on the screen a control that you need.
    2. See .onReady() in page's source (View Source in browser)
    3. Get the script to create a control.
  9. #9
    thks

    its hlep me lt off......
  10. #10
    That's a great example for the basic edit window, but what about for the large edit form?

    I tried this in the listener for EditDetails, but it didn't work.

    edit: function (win, rec) {
             win.hide();         
            Calendar1.showEditForm(rec);
            Ext.get(Ext.query("form", "Calendar1-edit")).add({ id: 'TextField1', fieldLabel: 'TextField1', xtype: 'textfield' });
     }
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 15
    Last Post: Sep 17, 2012, 2:13 PM
  2. Replies: 0
    Last Post: May 16, 2012, 11:29 PM
  3. [CLOSED] [1.0] Dynamically add control
    By danielg in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 09, 2010, 9:45 AM
  4. [CLOSED] Change Tab Name dynamically in Tab Control
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 19, 2009, 2:45 AM
  5. Dynamically loading a user control
    By kene in forum 1.x Help
    Replies: 0
    Last Post: Mar 16, 2009, 7:28 AM

Tags for this Thread

Posting Permissions