-
13 Dec 2010 6:33 PM #51
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?
Jack S.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'); });
-
16 Dec 2010 11:22 AM #52
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:
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:Code://listen for window resize Ext.EventManager.onWindowResize(function () { //console.log('resize'); grid.initComponent(); });
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
-
16 Dec 2010 5:03 PM #53Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 435
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Dec 2010 5:05 PM #54Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 435
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Dec 2010 6:02 PM #55Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 435
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
17 Dec 2010 4:51 AM #56
@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
-
17 Dec 2010 5:59 AM #57Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 435
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
17 Dec 2010 7:30 AM #58
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
-
17 Dec 2010 8:23 AM #59Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 435
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
17 Dec 2010 9:10 AM #60
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?


Reply With Quote