1. #171
    Sencha Premium Member
    Join Date
    Aug 2008
    Posts
    209
    Vote Rating
    4
    squarefan is on a distinguished road

      0  

    Default


    I just tried to cancel/abort the load operation and saw that the Loading mask stays in place. Using the standard check Ext.fly('mask') just returns null (even though the loading mask is still there) and using Ext.getBody().unmask() also doesnt work...

    any ideas how I can check and reset the loading mask?

    cheers,
    Alex

  2. #172
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    16
    tomalex0 will become famous soon enough

      0  

    Default


    @ Mitchell

    I have seen an issue reported when using renderer function, me too came across the same. Hope you already know about the issue

    The thing i was trying to do is to display two column values in each cell similar to how we do it in Extjs Grid.

    Few things i noticed is the

    Code:
    data[column.mapping] = column.renderer.apply(me, [data[column.mapping]]);
    Lets say mapping name is change and one of its rows values in 10
    Code:
    renderer : function(value) {
    					return "<span style='color: #" + color + ";'>" + value +"Values</span>";
    				}
    so after renderer function is carried out the value of change will become

    Code:
    <span style='color: #FF0000;'>10 Values</span>
    And on each sort it seems + value +

    is get replaced with the html.

    is there any quick fix for this, i'm also trying to solve this

  3. #173
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    16
    tomalex0 will become famous soon enough

      0  

    Default Solved

    Solved


    Below code seems to fix the problem i was facing regarding renderer

    Replace the current prepareData function
    Code:
    prepareData  : function(data, index, record) {
    				var column,
    					i  = 0,
    					ln = colModel.length;
    				var prepare_data = {};
    				prepare_data.dirtyFields = {};
    				for (; i < ln; i++) {
    					
    					column = colModel[i];
    					if (typeof column.renderer === "function") {
    						prepare_data[column.mapping] = column.renderer.apply(me, [data[column.mapping],column, record, index]);
    					} else {
    						prepare_data[column.mapping] = data[column.mapping];
    					}
    				}
    				
    				prepare_data.isDirty = record.dirty;
    
    				prepare_data.rowIndex = index;
    				return prepare_data;
    			}
    Now renderer can take parameters like index,record ..
    and we can use like this
    Code:
    renderer : function(value,column,record,index) {
    					var color = (value > 0) ? "00FF00" : "FF0000";
    					return "<span style='color: #" + color + ";'>" + value +"--"+record.get('company')+"-this text</span>";
    				}
    I have not tested it fully but it worked in my implementation.

    If there is any issue please post here, so i will be aware

  4. #174
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,640
    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


    Cool, thanks @tomalex0. Work will start on Sencha Touch again soon so you may be seeing some things from me in there with the help from the core devs who are, IMHO, a million times smarter than me
    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.

  5. #175
    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 Mitchell,

    Do you have any insight on how I could make custom sorting work for a specific column? Would much appreciate a solution for this.

    Cheers,
    Nico
    Bump! It would be really cool to get this to work. Since I'm having some dates, and I need to be able to sort by date. If anyone knows how to do this, let me know!

  6. #176
    Touch Premium Member
    Join Date
    Nov 2010
    Posts
    30
    Vote Rating
    0
    Buckeye is on a distinguished road

      0  

    Default


    Directly sort your store should work.

    Code:
     this.store.sort(obj.sortColumn, 'ASC');
     this.store.sort(obj.sortColumn, 'DESC');

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

      0  

    Default


    Quote Originally Posted by Buckeye View Post
    Directly sort your store should work.

    Code:
     this.store.sort(obj.sortColumn, 'ASC');
     this.store.sort(obj.sortColumn, 'DESC');
    The plugin is already calling the sort() function for the store:
    this.store.sort(mapping);

    But how do I apply custom sorting for the store columns?

  8. #178
    Sencha User
    Join Date
    Mar 2008
    Posts
    5
    Vote Rating
    0
    robertvonk is on a distinguished road

      0  

    Default


    I'm using the touchgridpanel and I'm verry happy with it.
    One small question , is it possible to set the background color of a whole row based upon
    a value in the datarow of the store? The sample provided shows a way to render the value in a cell, but
    I need to change the color of a entire row

    thanks

  9. #179
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    16
    tomalex0 will become famous soon enough

      0  

    Default


    I'm not sure if we can set row color in a fly. But you can user renderer function to color each cell. So coloring every cell in a row based on some value can do the trick

  10. #180
    Sencha Premium Member
    Join Date
    Aug 2008
    Posts
    209
    Vote Rating
    4
    squarefan is on a distinguished road

      0  

    Default


    @tomalex

    thanks for your help with the rendering function. I tried to change the cell background-color, but having troubles to change the parent td css style. When changed at styles: it works, but there I don't have the possiblity to check on a specific value.

    Do you have any pointers how I could change the cell background color from within the renderer function?

    thx in advance!

    cheers,
    Alex