How to display a menu with ItemContextMenu

  1. #1

    How to display a menu with ItemContextMenu

    Good morning.
    Let me know how I can display a menu to select a record for gridPanel right click.

    ext.net V2

    Click image for larger version. 

Name:	Example A .jpg 
Views:	119 
Size:	88.7 KB 
ID:	4990
      <%-- in  GridPanel : --%>
    <Listeners>
      <RowContextMenu Handler="e.preventDefault(); #{RowContextMenu}.dataRecord = this.store.getAt(rowIndex);#{RowContextMenu}.showAt(e.getXY());" />
    </Listeners>
    
    <%-- Menu: --%>
     <ext:Menu ID="RowContextMenu" runat="server">
       <Items>
            <ext:TextMenuItem ID="CompanyLabel" runat="server" CtCls="company-label"  />
            <ext:MenuItem runat="server" Text="Delete" Icon="Delete"/>
            <ext:MenuItem runat="server" Text="Print" Icon="Printer" />
            </Items>
      </ext:Menu>
  2. #2
    Quote Originally Posted by billy View Post
    Good morning.
    Let me know how I can display a menu to select a record for gridPanel right click.

    ext.net V2

    Click image for larger version. 

Name:	Example A .jpg 
Views:	119 
Size:	88.7 KB 
ID:	4990
      <%-- in  GridPanel : --%>
    <Listeners>
      <RowContextMenu Handler="e.preventDefault(); #{RowContextMenu}.dataRecord = this.store.getAt(rowIndex);#{RowContextMenu}.showAt(e.getXY());" />
    </Listeners>
    
    <%-- Menu: --%>
     <ext:Menu ID="RowContextMenu" runat="server">
       <Items>
            <ext:TextMenuItem ID="CompanyLabel" runat="server" CtCls="company-label"  />
            <ext:MenuItem runat="server" Text="Delete" Icon="Delete"/>
            <ext:MenuItem runat="server" Text="Print" Icon="Printer" />
            </Items>
      </ext:Menu>
    We found the problem
    replacement
    <Listeners>
    <ItemContextMenu Handler="e.preventDefault(); #{mnOpciones}.showAt(e.getXY()); SeleccionarFila(rowIndex,App.grdCostos,true);" />
    </Listeners>
    to

      < ItemContextMenu Handler="e.preventDefault();#{RowContextMenu}.showAt(e.getXY());" />
    For anyone who is learning as I ext.net 2.0 and demonstrates. :)
    Last edited by billy; Oct 30, 2012 at 9:17 PM.

Similar Threads

  1. Replies: 7
    Last Post: Sep 26, 2012, 7:46 PM
  2. Replies: 2
    Last Post: Apr 02, 2012, 7:48 AM
  3. Menu Position - Always display up instead of down
    By Tbaseflug in forum 1.x Help
    Replies: 1
    Last Post: May 07, 2010, 10:48 AM
  4. Conditional display of menu
    By olakara in forum 1.x Help
    Replies: 2
    Last Post: Apr 15, 2010, 3:23 AM
  5. How to display context menu?
    By dbassett74 in forum 1.x Help
    Replies: 4
    Last Post: May 14, 2009, 2:37 PM

Posting Permissions