Results 1 to 10 of 10

Thread: Extjs Grid cell click for popup window

  1. #1
    Ext User
    Join Date
    May 2007
    Posts
    14
    Vote Rating
    0
      0  

    Default Extjs Grid cell click for popup window

    Hi All,

    I have got requirement like i have loaded my Ext grid with data. When i click on the perticular cell i should open window.showmodeldialog with that cell data to the popup and i can change that record data and i should refresh the parent grid for the updated data once i saved the popup data.

    How to write the event to select the cell or column similar to
    grid.on('click', this.gridSelectionHandler, this);

    I will appriciate your early response as i need to finish this task early for the tommorow release.


    Thanks,
    Srikanth

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    3
      -1  

    Default

    There are examples of this in the forum. You'll have to search. Also, please stop asking for quick responses - nobody here is obligated to help you meet your deadlines. The community will help when they have time and answers.

  3. #3
    Sencha User
    Join Date
    Oct 2007
    Posts
    239
    Vote Rating
    0
      0  

    Default

    did you ever find out the solution?

  4. #4

  5. #5
    Ext User
    Join Date
    Dec 2009
    Posts
    1
    Vote Rating
    0
      0  

    Default sample on

    here sample

    Code:
    grid.on({
    'click' : {
    fn: this.prueba,
    scope: this											
    													  }
    											});

  6. #6
    Sencha User
    Join Date
    Dec 2011
    Location
    Bangalore, India
    Posts
    17
    Vote Rating
    0
      0  

    Thumbs up Solution:

    It is simple:
    1. Create a action column, specify handler function on that, ensure that handler has all the parameters including event parameter. It would be 5th parameter in order. i.e. function(a,b,c,d,event)
    2. Use event methods getXY, getX and getY
    3. Create a global popup variable. Define it before the class defination.
    i.e.
    var popup;
    Ext.define().....
    4. Then create popup component
    eg:- popup = Ext.create(Ext.Component.....)
    4. popup.setPosition(event.getX(),event.getY()) and popup.show()

  7. #7
    Sencha User
    Join Date
    Feb 2011
    Posts
    1
    Vote Rating
    0
      0  

    Default Grid Cell Click popup

    Hello.
    Do you know another solution for do that...?

  8. #8
    Sencha User
    Join Date
    Oct 2008
    Posts
    5
    Vote Rating
    0
      0  

    Default CellClick Solution for Ext 4

    In your grid constructor code:
    Code:
       this.on({cellclick: {     fn:this.showPopup,      scope: this   });
    Then put in these methods in your grid:
    Code:
       showPopup: function (grid,td,cellIndex,record,tr,rowIndex,e,eOpts) {     var columnIndex = this.getColumnIndex(grid, 'YourCellColumnNameThatYouWantClicked');     if (cellIndex == columnIndex) {       //you have a match...do your popup code here    } }, getColumnIndex: function (grid, dataIndex) {   var gridColumns = grid.headerCt.getGridColumns();   for (var i = 0; i < gridColumns.length; i++) {     if (gridColumns[i].dataIndex == dataIndex) {      return i;    }   } }

  9. #9
    Sencha User
    Join Date
    Oct 2008
    Posts
    5
    Vote Rating
    0
      0  

    Default cell click

    sorry that code came out on one line! Don't know why...

  10. #10
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Bangalore
    Posts
    79
    Vote Rating
    1
      0  

    Default

    How to open different popup window for each cell?

    My each cell will have its custom component, i need to open popup window how can i achieve tht ?

Posting Permissions

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