[CLOSED] add a directevent when select the DropDownField ?

  1. #1

    [CLOSED] add a directevent when select the DropDownField ?

    when user click the column , i want to init treepanel in code behind. but how to add the direct event?
     <ext:Column runat="server" DataIndex="pid" Text="父类别" Flex="1">
                                    <Renderer Fn="r_p_product_type" />
                                    <Editor>
                                        <ext:DropDownField runat="server" Mode="ValueText">
                                            <Component>
                                                <ext:TreePanel runat="server" ID="tp_product_type1"></ext:TreePanel>
                                            </Component> 
                                        </ext:DropDownField> 
                                    </Editor> 
                                </ext:Column>
     protected void SelectPtype(object sender, DirectEventArgs e)
            {
                X.Msg.Alert("sss","ssddd").Show();
                //  here to init treepanel tp_product_type1
            }
    Click image for larger version. 

Name:	QQ截图20131129225441.jpg 
Views:	9 
Size:	78.0 KB 
ID:	7303
    Last edited by Daniil; Dec 06, 2013 at 1:00 PM. Reason: [CLOSED]
  2. #2
    Hello!

    I'd suggest to use JS handler with DirectMethod like in this example: https://examples2.ext.net/#/TreePane...Direct_Method/
  3. #3
    Quote Originally Posted by Baidaly View Post
    Hello!

    I'd suggest to use JS handler with DirectMethod like in this example: https://examples2.ext.net/#/TreePane...Direct_Method/
    i mean which direct event i should use when user click the column rather than how to load treepanel's items.
  4. #4
    There are two options.

    1) Listen Expand event:

    <Editor>
    	<ext:DropDownField ID="DropDownField2" runat="server" Mode="ValueText">
    		<DirectEvents>
    			<Expand OnEvent="SelectPtype" />
    		</DirectEvents>
    		<Component>
    			<ext:TreePanel runat="server" ID="TreePanel1"></ext:TreePanel>
    		</Component>
    	</ext:DropDownField>
    </Editor>
    2) Listen BeforeEdit of CellEditing plugin:

    <ext:CellEditing runat="server">
        <DirectEvents>
            <BeforeEdit OnEvent="SelectPtype" Before="
                return el.activeColumn.dataIndex == 'pid;
                ">
            </BeforeEdit>
        </DirectEvents>
    </ext:CellEditing>

Similar Threads

  1. Replies: 5
    Last Post: Mar 19, 2014, 3:35 AM
  2. Replies: 0
    Last Post: Jan 22, 2013, 2:50 PM
  3. [CLOSED] DropDownField Select Event
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 19, 2012, 9:34 AM
  4. Replies: 1
    Last Post: Jun 09, 2011, 7:04 PM
  5. [CLOSED] ComboBox fires Select DirectEvent twice
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 05, 2011, 9:52 AM

Posting Permissions