Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: OnRowOut doesn't work as I wish

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
      0  

    Default OnRowOut doesn't work as I wish

    I am having a column in my grid that contains a button, this button is visible after onRowOver and hidden after onRowOut from my gridView :

    http://img20.imageshack.us/i/mouseover.jpg/

    Code:
    @Override
    	    protected void onRowOver(Element row) {
    	        super.onRowOver(row);	
    	        int rowIndex = findRowIndex(row);
    	        //take last column
    	        Button b = (Button) getWidget(rowIndex,getColumnData().size()-1);	        
    	        wb.setVisible(true);
    	    }
    @Override
    	    protected void onRowOut(Element row) {
    	        super.onRowOut(row);
    	        int rowIndex = findRowIndex(row);
    	        final Button b = (Button) getWidget(rowIndex,getColumnData().size()-1);
    	        b.setVisible(false);
    	        b.addListener(Events.OnMouseOver, new Listener<BaseEvent>() {
                    @Override
    				public void handleEvent(BaseEvent be) {
    					b.setVisible(true);	
    				}   
                });
    	    }
    but of course when my mouse cursor is over the button, it's considered as Out of the Row (onRowOut ==> not visible anymore) so I tried to keep it visible when my mouse is over this button, but I am still having issues doing it.

    Any ideas?

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    Edited my post.

    Which version of GXT are you using?

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
      0  

    Default

    hmmm I see...
    Thank you sven, I will try to implement it by myself in that case. I will keep the thread updated if anything is done from my side.

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    Quote Originally Posted by sven View Post
    Which version of GXT are you using?
    You probably also need to increase the rowselectordepth, as the button adds markup. There is a setter on the view.

  5. #5
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
      0  

    Default

    I am using the 2.2.0
    and what I did is basically the opposite algorithm (when you have onRowOver and onRowSelect, you hide the other buttons from other rows)

    here is the code of my customized GridView if anyone is interested (I do the same onRowSelect)

    Code:
    protected void onRowOver(Element row) {
    	        super.onRowOver(row);	
    	        for(int i = 0; i < getRows().getLength(); i++){
    	        	Button b = (Button) getWidget(i,getColumnData().size()-1);	        
    		        b.setVisible(false);
    	        }
    	        int rowIndex = findRowIndex(row);
    	        //take last column
    	        Button b = (Button) getWidget(rowIndex,getColumnData().size()-1);	        
    	        b.setVisible(true);
    	    }

  6. #6
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    As you use GXT 2.2.X you simple need to increase the rowselectordepth and should not need any further workarounds

  7. #7
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
      0  

    Default

    What does rowselectordepth exactly reflect?
    If I set it to a higher value, will it look at the button as a part of the row? (so no more confusion on the onRowOut?)

  8. #8
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    If I set it to a higher value, will it look at the button as a part of the row? (so no more confusion on the onRowOut?)
    Yes

  9. #9
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
      0  

    Default

    Sorry sven, but I am not able to find any help/documentation about what exact effect the value change of rowselectordepth has. Would you mind giving me a link on a thread already open on the forum, or an outside link to check it out?
    I couldn't find anything on the forum

  10. #10
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    It sets the maximum depth an element can have so it still counts as part of the row.

Page 1 of 2 12 LastLast

Similar Threads

  1. GridPanel OnRowOver OnRowOut Events? Ext 2.0
    By anshubansal2000 in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 16 Jun 2009, 7:46 AM
  2. appendChilds doesn't work
    By chrizmaster in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 27 Mar 2009, 5:52 AM
  3. Form Json Submit doesn't work but the Load work
    By dieyoudie in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 14 Dec 2007, 2:13 PM
  4. Code won't work in IE7, no JS errors, just doesn't work
    By blackwaterdev in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 17 Sep 2007, 5:06 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
  •