1. #11
    Sencha User
    Join Date
    Feb 2010
    Posts
    91
    Vote Rating
    0
    TheBigOnion is on a distinguished road

      0  

    Default


    Can I put some type of alert?

  2. #12
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    855
    Vote Rating
    38
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default


    Get Firebug for Firefox, or use Chrome and it's developer tools.

    Load the tools, load your page, go to scripts panel and find your file, put breakpoint on line by clicking on the left margin by the code.

  3. #13
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,098
    Vote Rating
    113
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Quote Originally Posted by TheBigOnion View Post
    How do I put a break point or log point in? And what variable should I be looking at?
    Setting a breakpoint in Firebug
    http://getfirebug.com/doc/breakpoints/demo.html
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #14
    Sencha User
    Join Date
    Feb 2011
    Posts
    63
    Vote Rating
    0
    joelchu is on a distinguished road

      0  

    Default Got it working but ...

    Got it working but ...


    How do I find out which cell I am right click into?

    Basically I need to have context menu on certain cells but not all of them.

    itemcontextmenu: function(view, rec, node, rowIndex, e) (there is no colIndex ...)

    Thanks for all your help.

  5. #15
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    855
    Vote Rating
    38
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default


    Not tried it but I guess you may have to use a more sophisticated renderer for the cell, render an element to it, and attach a listener to its contextmenu event.
    Product Architect
    Altus Ltd.

  6. #16
    Sencha User
    Join Date
    Feb 2011
    Posts
    63
    Vote Rating
    0
    joelchu is on a distinguished road

      0  

    Default thanks

    thanks


    OK , will try this and post back in this forum.

    Thanks

  7. #17
    Sencha User
    Join Date
    Feb 2011
    Posts
    63
    Vote Rating
    0
    joelchu is on a distinguished road

      0  

    Default found a may be solution

    found a may be solution


    The problem is a mouse right click is disconnected from the element under it.

    For instance
    PHP Code:
    itemcontextmenu: function(view recnoderowIndexe) {
            
    e.stopEvent();
            
    itemContextMenu.showAt(e.getXY());

    There seems to be no way to pass the underlying element to the contextMenu?

    I found a way around it - not elegant but it works.

    PHP Code:
    itemcontextmenu: function(view recnoderowIndexe) {
            
    e.stopEvent();
            var 
    items itemContentMenu.items.item;
            var 
    ctn    items.length;
            for (var 
    i=0i<ctn; ++i) {
                 
    items[i].specialJoelInjectedElement = {viewview recrecnodenoderowIndexee};
             }
             
    itemContextMenu.showAt(e.getXY());

    This is the itemContextMenu

    PHP Code:

    var itemContextMenu Ext.create('Ext.menu.Menu' , {items: [specialAction]}); 
    And this is the special action

    PHP Code:

    var specialAction Ext.create('Ext.Action', {
           
    text'Special action',
           
    handler: function(widget event) {
                  
    // here is the magic
                  
    var myObject widget.specialJoelInjectedElement ;
                  
    // then you get back what you just pass. Do try this at home ....

                  // do stuff
          
    }

    }); 
    Last edited by joelchu; 27 Jul 2011 at 5:13 AM. Reason: grammer

  8. #18
    Touch Premium Member
    Join Date
    Jan 2011
    Location
    Lisbon, Portugal
    Posts
    192
    Vote Rating
    0
    jmaia is on a distinguished road

      0  

    Default


    Quote Originally Posted by aconran View Post
    Take a look at:
    http://dev.sencha.com/deploy/ext-4.0...tion-grid.html

    We subscribe to itemcontextmenu and then use the event's XY coordinates to position the context menu.
    Hello there,

    I was looking through this thread because I had a similar problem, and looking at the example I managed to get my context menu to work on the grid, however there is a slight difference between the behavior of the action grid example and my grid, even though I looked at the code and can't spot any obvious differences.

    What happens on the example (and not on my grid) is that when I right click on a row, the row is selected and the context menu shows up on that row. When the menu is still showing, if I right click on another row that row gets selected in turn and the menu shows up on that second row.

    Now what happens on my grid is that I right click on a row, the row gets selected and the menu shown. Cool. But when I right click on another row, that row does not get selected, but the menu still shows on the second row.

    I tried removing all listeners from the grid, and the problem remains. I right click on a row, row gets selected. I right click on another row, row does not get selected. From the first right click onwards it seems that the action of right clicking a row does not select the row anymore...

    Any thoughts ?

    Thanks,

    jm

Similar Threads

  1. Gridpanel: Contextmenu / right-click menu
    By jlg in forum Ext: Discussion
    Replies: 1
    Last Post: 15 Mar 2011, 3:09 AM
  2. GridPanel column headers-right click menu question
    By memills in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 7 Jul 2009, 7:37 AM
  3. [1.2.3] Browser's right click menu pops up with ContextMenu
    By seast in forum Ext GWT: Help & Discussion (1.x)
    Replies: 2
    Last Post: 1 Mar 2009, 11:32 PM
  4. One-click drown down menu in GridPanel
    By jdobrowski in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 29 Apr 2008, 1:29 PM
  5. Replies: 0
    Last Post: 3 Mar 2008, 1:46 PM

Thread Participants: 4

Tags for this Thread