1. #131
    Sencha User
    Join Date
    Jan 2011
    Posts
    59
    Vote Rating
    0
    Nicodemuz is on a distinguished road

      0  

    Default


    Quote Originally Posted by Nicodemuz View Post
    Hi,

    It seems like the renderer() function does not work with the new release. Is there some other way to achieve the same result?

    Cheers!
    Bump! I noticed that the renderer() function has been removed from the new version. Is there any way I can preformat the data from my store? This would be a very useful addition to the plugin.

    Thanks!

  2. #132
    Sencha User
    Join Date
    Dec 2010
    Posts
    69
    Vote Rating
    0
    irocker is on a distinguished road

      0  

    Default


    Quote Originally Posted by Nicodemuz View Post
    Bump! I noticed that the renderer() function has been removed from the new version. Is there any way I can preformat the data from my store? This would be a very useful addition to the plugin.
    Yes, you can use style: instead, and use standard CSS to format the data. Check out the source to Mitchell's demo.

  3. #133
    Sencha User
    Join Date
    Dec 2010
    Posts
    69
    Vote Rating
    0
    irocker is on a distinguished road

      0  

    Default


    Quote Originally Posted by acslater View Post
    I am having problems getting the store loaded into my grid, however. I can see the column headings but no data rows. I am attempting to include a TouchGridPanel in a TabPanel. Here is what I have for my TouchGridPanel . Am I missing something?
    Yes, your JSON isn't valid when you define your store. Try this instead:

    Code:
    data: [{
            "restaurant" : "Wal-Mart Stores Inc.",
            "power" : "23" 
        }]

  4. #134
    Sencha User
    Join Date
    Jan 2011
    Posts
    59
    Vote Rating
    0
    Nicodemuz is on a distinguished road

      0  

    Default


    Quote Originally Posted by irocker View Post
    Yes, you can use style: instead, and use standard CSS to format the data. Check out the source to Mitchell's demo.
    Sorry, by formatting, I didn't mean visually formatting the data. For example, I'm having some type codes in my store, and would like to preformat these to something more readable. For example:
    ACT -> Active

  5. #135
    Sencha User
    Join Date
    Jan 2011
    Posts
    59
    Vote Rating
    0
    Nicodemuz is on a distinguished road

      0  

    Default


    Quote Originally Posted by Nicodemuz View Post
    Sorry, by formatting, I didn't mean visually formatting the data. For example, I'm having some type codes in my store, and would like to preformat these to something more readable. For example:
    ACT -> Active
    I made a small workaround by extending the Ext.DataView. I added the following lines of code after line 135 (version 2.0b1):
    Code:
    			prepareData:function(recordData, ri, record) {
    				
    				for (var i = 0; i < colModel.length; i++) {
    					var col   = colModel[i];
    					
    					if(typeof col.renderer == 'function') {
    						recordData[col.mapping] = col.renderer.apply(this, [recordData[col.mapping]]);
    					}
    					
    				}
    				
    				return recordData;
    			}
    Seems to work quite okay!

  6. #136
    Sencha User
    Join Date
    Jan 2011
    Posts
    59
    Vote Rating
    0
    Nicodemuz is on a distinguished road

      0  

    Default


    Quote Originally Posted by Nicodemuz View Post
    I made a small workaround by extending the Ext.DataView. I added the following lines of code after line 135 (version 2.0b1):
    Code:
    			prepareData:function(recordData, ri, record) {
    				
    				for (var i = 0; i < colModel.length; i++) {
    					var col   = colModel[i];
    					
    					if(typeof col.renderer == 'function') {
    						recordData[col.mapping] = col.renderer.apply(this, [recordData[col.mapping]]);
    					}
    					
    				}
    				
    				return recordData;
    			}
    Seems to work quite okay!
    Nevermind, this killed sorting!! Anyone able to give a hand?

  7. #137
    Sencha User
    Join Date
    Jan 2011
    Posts
    59
    Vote Rating
    0
    Nicodemuz is on a distinguished road

      0  

    Default


    This seems to work better! 8)

    Code:
    prepareData:function(recordData, ri, record) {
    	
    	if(recordData.rendered) return recordData;
    	
    	for (var i = 0; i < colModel.length; i++) {
    		var col   = colModel[i];
    		
    		if(typeof col.renderer == 'function') {
    			recordData[col.mapping] = col.renderer.apply(this, [recordData[col.mapping]]);
    		}
    		
    	}
    	
    	recordData.rendered = true;
    	
    	return recordData;
    }

  8. #138
    Sencha User
    Join Date
    Jan 2011
    Posts
    59
    Vote Rating
    0
    Nicodemuz is on a distinguished road

      0  

    Default


    Is there a way to "scrollTo" to a specific table row?

  9. #139
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,641
    Vote Rating
    898
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by Nicodemuz View Post
    Is there a way to "scrollTo" to a specific table row?
    Check out GitHub... I added a 'scrollToRow' method that accepts the row index. Example:

    Code:
    grid.scrollToRow(5)
    Also a surprise in last build
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  10. #140
    Sencha User
    Join Date
    Jan 2011
    Posts
    59
    Vote Rating
    0
    Nicodemuz is on a distinguished road

      0  

    Default


    Hi Mitch!

    The renderer function seems to break when you apply sorting on the columns. Each time the user clicks on the columns to perform a sort, the cell is rendered.

    For example, my price column becomes $$$$1 after sorting a few times.

    The same seems to happen on your demo, but it's not so visible. After sorting a few times, the "Change" column values get some additional code:
    <span style="color: #FF0000;"><span style="color: #FF0000;"> ... </span></span>

    Cheers!