Results 1 to 9 of 9

Thread: [SOLVED] How do I write this into a listener in the GripPanel configuration?

  1. #1
    Ext JS Premium Member Elijah's Avatar
    Join Date
    Nov 2009
    Location
    USA
    Posts
    382

    Default [SOLVED] How do I write this into a listener in the GripPanel configuration?

    This works but other issues I have may be from this so i want to put it into a listener in the config.
    Code:
    argGridPanel.getSelectionModel().on('rowselect', function(sm, rowIdx, r) {
        taskTpl.overwrite(
            Ext.getCmp('gridPanelItemDetail' + argUniqueID).body, r.data
        );
    });

    Below does not work.
    Code:
    argGridPanel = new Ext.grid.GridPanel({
      ...,
      listeners: {
        rowselect: function(sm, rowIdx, r) {
            taskTpl.overwrite(
                Ext.getCmp('gridPanelItemDetail' + argUniqueID).body, r.data
            );
        } // rowselect
      }
    })

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    What are you asking? You have added a listener, so it can't be how to add a listener...

  3. #3
    Ext JS Premium Member Elijah's Avatar
    Join Date
    Nov 2009
    Location
    USA
    Posts
    382

    Default

    When i use the code portion at the very top and click on a row in the Grid Panel the event fires and the call to open the url fires.

    When I try to use the listener code below it, nothing occurs. nothing shows up in fireBug like I did not click at all.

    So I thought I am implementing the listener code incorrectly (i.e. wrong syntax or something)

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    GridPanel does not have a rowselect event.

    As you know. Because you have added a rowselect listener to the correct object above!

  5. #5
    Ext JS Premium Member Elijah's Avatar
    Join Date
    Nov 2009
    Location
    USA
    Posts
    382

    Default

    Right it does NOT.

    Hence the question about getting this "argGridPanel.getSelectionModel().on('rowselect',..." to work on a listener in the gridPanel.
    Code:
      listeners: {
        // this does fire but now I have no idea where my data went or how to get at it.
        rowclick: function(argGrid, rowIdx, e) {....
        } // rowclick
      }
    I could really use some direct syntax. Demo is suppose to be tommorow and the backend person still has not gotten me the code base I need and each time I get something from them it requires me to change stuff I have working but expecting different type of data.

    Remember where I am working is a friggin hole in the ground where I do not have network connectivity. Had to get permission to work out of there this afternoon.

  6. #6

    Default

    Code:
    argGridPanel = new Ext.grid.GridPanel({
      selModel: new Ext.grid.RowSelectionModel({
        ...,
        listeners: {
          rowselect: function(sm, rowIdx, r) {
              taskTpl.overwrite(
                  Ext.getCmp('gridPanelItemDetail' + argUniqueID).body, r.data
              );
          } // rowselect
        }
      })
    })

  7. #7
    Ext JS Premium Member Elijah's Avatar
    Join Date
    Nov 2009
    Location
    USA
    Posts
    382

    Default

    Thanks darthwes that code snippet was exactly what I needed to see.
    I had also seen in some code sm: new Ext.gridRowSelectionModel....
    Where is the main index listing that shows all these shorthands being still new to the library I can only poorly guess what it could be.

    Hmm lets see sm:? sexy model, scary movie, secret method blah blah blah. Thanks again all for the responses.

  8. #8

    Default

    Here is the main API documentation.

    sm is a shorthand for selModel. The only way I know this is I read the documentation for GridPanels about 400 times. Eventually stuff started sticking...

    They don't have a listing of short hands that I know of, but when you look in the API at GridPanel's sm config attribute it says that it is an alias for selModel.

  9. #9
    Ext JS Premium Member Elijah's Avatar
    Join Date
    Nov 2009
    Location
    USA
    Posts
    382

Similar Threads

  1. [Resolute]gripPanel with groupingView
    By Mitaka in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 24 Sep 2008, 12:12 AM
  2. GripPanel not showing in Tab
    By killerboy in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 12 Jun 2008, 3:47 AM
  3. Pass Listener Configuration from JSON?
    By paladinjack in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 15 Jan 2008, 8:30 AM
  4. QuickTips configuration
    By para in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 14 Jan 2008, 1:04 PM
  5. Configuration of the grid
    By olimpia in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 30 May 2007, 6:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •