-
26 Dec 2012 7:14 AM #1
Unanswered: Ext.List remove padding of list items
Unanswered: Ext.List remove padding of list items
Hi. My list items are basically tables. But they don't take the whole space in list item.
bad.JPG
I tried to do the following.
Defined the following CSS
.x-categories .x-list-item-label {
padding: 0 0.65em 0 0.65em !important; /* top right bottom left*/
}
and put the following cls into list definition
but it didn't help. Can someone assist?Code:config: { cls: 'x-categories', itemTpl: '<table border="1" width="100%" height="100%"><tr>{STATUS}{VISIT_DATE}{SUBMIT_DATE}{COMMENTS}{DELETE_IMG}</tr></table>', store: null, items: [ { xtype:'toolbar', docked:'top', baseCls:"accountsCallsToolbar", html: '<table border="1" width="100%" height="100%"><tr><td width="1.5%"><span></span></td><td width="25%" align="left" valign="middle"><span> '+allLanguages[language]["Status"]+'</span></td><td width="25%" align="left" valign="middle"><span >'+allLanguages[language]["VisitDate"]+'</span></td><td width="25%" align="left" valign="middle"><span>'+allLanguages[language]["SubmitDate"]+'</span></td><td width="25%" align="left" valign="middle"><span>'+allLanguages[language]["comments"]+'</span></td><td width="5%"><span></span></td></tr></table>' } ] }
-
28 Dec 2012 7:14 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
Any better?Code:.x-categories.x-list .x-list-item .x-list-item-label { padding: 0 0.65em 0 0.65em !important; }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.
-
31 Dec 2012 1:02 AM #3
Importunately no

Still list item is padded in the same way. In fact I see no effect at all after applying this style.
My boss
is going to kill me
Any other ideas
-
1 Jan 2013 6:42 AM #4
I made a little progress
After examining the elements with Chrome browser I defined the following CSS
.x-custom .x-list-item-body {
min-height: 46px;
padding: 0 0;
}
and
The good news that top, left and right padding disappeared, but table didn't occupy the entire parent element (see attached). How do I force it to fill the whole list item?Code:cls: 'x-custom', itemTpl: '<table border="1" width="100%" height="100%"><tr>{STATUS}{VISIT_DATE}{SUBMIT_DATE}{COMMENTS}{DELETE_IMG}</tr></table>', store: null,
bad_padding.JPG
-
3 Jan 2013 12:06 AM #5
-
3 Jan 2013 3:26 AM #6
For custom CSS I use the DataView which is much easier to configure.
JS
app.scssCode:{ xtype: 'dataview', baseCls: 'projectList' }
Code:projectList-item { height: 50px; span { line-height: 50px; color: blue; } .. }
-
6 Jan 2013 10:49 AM #7
This will require from me to rewrite a lot of code , when the only thing I am looking for is proper CSS class to change
-
6 Jan 2013 2:25 PM #8Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
When posting a question, please provide what version. There is a DOM difference between ST 2.0 and ST 2.1 for the List.
Your question can easily be found by inspecting the DOM, finding the element that has a padding and seeing what classes is being used to have the padding. Give it a try, right-click on the list, click on inspect element and start looking at the elements to find that padding.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.
-
7 Jan 2013 3:31 AM #9
Are you sure, because List extends DataView.
in 2.1, I find this for a List rather difficult, and so far I haven't managed to fully customize as I've done with a DataView. Even looking at the TouchTweets-example didn't resolve everything, if I remember correctly they didn't change the padding either.


Reply With Quote