1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    2
    Vote Rating
    0
    John-Mickael is on a distinguished road

      0  

    Post Scroll to specified DataView item

    Scroll to specified DataView item


    Hello,

    I'm new in sencha touch, and did not found any solution to my problem.

    I have a Tab Panel. On the first tab, i have a List with an XTemplate and on the second tab, i have a dataView with an XTemplate. The same informations are displayed on both panels, but the first tab is a summary and the second tab display the complete content, therefore there is a scrollbar.

    When i choose an item on the List, i switch to the second tab, and try to scroll the DataView in order to show the related item.

    I tried unsucessfully to use method presented here : http://www.sencha.com/forum/showthre...em-in-dataview

    I hope someone could help me.

    Thanks.
    JM

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    2
    Vote Rating
    0
    John-Mickael is on a distinguished road

      0  

    Default


    I found a solution in the following thread : http://www.sencha.com/forum/showthre...ew+scroll+item

    I had to change some little thinks :
    1) i replace the second's panel DataView by a List
    2) in the itemtap event of the first list i memorize the index of the selected item, and set the second tab as activeitem
    3) in the cardswitch event of the tabpanel i scroll to the position of the second list, if the newCard is the second panel.

    Code:
    cardswitch : function ( t, newCard, oldCard, index, animated ) {        	  		
    	         	  		if (newCard.id == 'newsPanel') {
    	         	  		   listId = push.selectedItem; //The index of selected item in first list
    	         	  		   if (listId != null)
    	 	                   {  
    	 	                   	push.pushDataViewNews.scroller.scrollTo({x:0,y:0}, false);
    
    	 	                    push.pushDataViewNews.select(listId);
    
    	 	                    var ehtml = push.pushDataViewNews.getNode(listId);
    	 	                    var el = Ext.get(ehtml);	 	                   	 	                    
    	 	                    var ykor =    el.getY(); //-push.pushDataViewNews.getHeight(); I had to remove this for a succefull scroll
    	 	                    var xkor =  el.getX();
    
    	 	                    push.pushDataViewNews.scroller.scrollTo({x:xkor,y:ykor}, true);
    	 	                    
    	 	                   push.selectedItem = null;
    	 	                    
    	 	                   }  
    	         	  		}
    	         	  		
    	         	  	}

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar