1. #51
    Sencha User
    Join Date
    Apr 2008
    Posts
    330
    Vote Rating
    0
    Jack_S is on a distinguished road

      0  

    Question Listeners

    Listeners


    Hello Mitchell,

    Just one question, do I need to include the ext-all from ExtJS for the listeners to work?

    The following resulted in NO events being fired from the grid?

    Code:
    var contactGrid = new Ext.ux.TouchGridPanel({
    			 id : 'contactGrid'
    			,fullscreen  : true
    			,store       : contactStore
    			
    			,dockedItems : [{
    				 xtype : 'toolbar'
    				,dock  : 'top'
    				,items : [{
    					 text    : 'Back'
    					,ui      : 'back'
    					,handler:function(){
                                          mainPanel.setActiveItem(0,{type:'slide'});
                                     }
    				}]
    			}]
    			,selModel    : {
    				singleSelect : true
    			}
    			,colModel:[
    			{
    			     header: 'First Name'
    				,mapping: 'FIRST_NAME'
    			},{
    			     header: 'Last Name'
    				,mapping: 'LAST_NAME'
    			},{
    			     header: 'Status'
    				,mapping: 'EMPLOYEE_STATUS'
    			}]
    			,listeners: {
    		         rowdblclick  : function (grid, index, e) {
    				    alert('row dbl clicked');
    					//mainPanel.setActiveItem('contactDetailPanel', {type: 'flip'});
    				 
    					//var form = Ext.getCmp('contactDetailPanel');
    					//var rec = grid.getSelectionModel().getSelected();
    					//form.load(rec);
    		        }
    		    }
    		});
    		contactGrid.on('rowclick', function(){
    			 alert('row clicked');
    		});
    Jack S.

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

      0  

    Default


    Hi,

    Maybe someone can help me with two things..

    1. Grid Rendering
    I want to highlight (change the background color) of a certain row - whole row - e.g. to green. I can already check the cell value to determine which row and can set the font color with the examples provided but don't know how to set the background color for the whole row.

    2. Resizing of the Grid
    I looked into the issue and could resize the grid combining the window resize listener of Touch and the initComponent of Touchgrid:

    Code:
           //listen for window resize
            Ext.EventManager.onWindowResize(function () {
                //console.log('resize');
                grid.initComponent();            
            });
    This actually works pretty well in both the browser and the iphone.. unfortuantely it always returns an error from the sencha-touch-debug.js... namely on every resize:

    TypeError: result of expression 'comp.getItemId' [undefined] is not a function

    well thats actually it.. thank you so much for this great plugin!!!

    cheers,
    Alex

  3. #53
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    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 Jack_S View Post
    Just one question, do I need to include the ext-all from ExtJS for the listeners to work?
    No you do not.

    Ok... this is kind of embarrassing. I changed from click to tap so rowtap works. My bad :-)

    If you go to http://www.simoens.org/Sencha-Projec...ouchGridPanel/ I echo out all the params in the listener (grid, el, rowIndex, e). el is wrapped as an Ext.Element.
    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.

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


    About resizing... the beauty of using CSS3 column layout is it's suppose to resize the columns to the available size if you do not specify column-width as I am not. I'm specifying column-count. I'm looking into it but it seems that ST Panel isn't resizing either so I'm working on it.
    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. #55
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    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


    Happy holidays to all! Go ahead, go to http://www.simoens.org/Sencha-Projec...ouchGridPanel/ and rotate your iOS device. See if it rotates because I just found out why it wasn't.

    Turns out I was overriding a crucial function, initEvents. So I added one line and it works! Git has been updated so grab it!

    Once again ***ORIENTATION BUG HAS BEEN FIXED***
    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.

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

      0  

    Default


    @mitchellsimoens

    FANTASTIC !!!

    thanks sooo much. that was one of my major problems... now I'm almost finished! Do you maybe also have a pointer for my second "issue"... how to highlight the whole row in the grid with a specific color??

    cheers,
    Alex

  7. #57
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    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 squarefan View Post
    @mitchellsimoens

    FANTASTIC !!!

    thanks sooo much. that was one of my major problems... now I'm almost finished! Do you maybe also have a pointer for my second "issue"... how to highlight the whole row in the grid with a specific color??

    cheers,
    Alex
    So you want the whole row in a color when the grid is rendering?
    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.

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

      0  

    Default


    yup.. i'm checking a field lets call it --> is_awesome. when that field is e.g. true then i want to set the background over the whole row. I can already check the value etc. but don't know how to set the background color for the whole row.

    cheers,
    Alex

  9. #59
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    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


    The problem is that the column renderers render the cell when the grid body is rendered. So you would have to do this post-grid body render as it stands right now.
    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. #60
    Sencha Premium Member
    Join Date
    Aug 2008
    Posts
    209
    Vote Rating
    4
    squarefan is on a distinguished road

      0  

    Default


    OK IC... do you have maybe a guideline how I could do that? do i have to iterate through the store and then overwrite the style for the correct row?