-
16 Sep 2012 6:09 PM #1
Unanswered: Setting Background image to xtype:list
Unanswered: Setting Background image to xtype:list
i am trying to set a background image to a list...i can get it working with panel. but it does not work with list.
Help appreciated please... I need to submit my assignment.Code:Bollist.js Ext.define('tabla.view.Bollist', { extend:'Ext.Panel', xtype:'Bollist', config:{ title:'Bols', iconCls:'music2', layout:'fit', styleHtmlContent:true, scrollable:{ direction:'vertical' }, items:[ { xtype:'list', store:'BolStore', itemTpl:'{name}' } ] } }); Main.js Ext.define("tabla.view.Main", { extend: 'Ext.tab.Panel', requires: [ 'Ext.TitleBar', 'Ext.dataview.List' ], config: { tabBarPosition: 'bottom', items: [ { style:{ backgroundImage:'url(resources/images/bg.png)', backgroundRepeat:'repeat', backgroundPosition:'center', backgroundSize:'cover' }, xtype:'home' }, { style:{ backgroundImage:'url(resources/images/bg.png)', backgroundRepeat:'repeat', backgroundPosition:'center', backgroundSize:'cover' }, xtype:'Bollist' } ] } });
-
18 Sep 2012 5:40 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
What do you mean?
Did you inspect the DOM to see if the List has it's own styles that could prevent it from showing your style?but it does not work with listMitchell 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.
-
18 Sep 2012 7:35 AM #3
If i change the xtype of the item in Bollist.js from list to panel....the background image shows but the list disappears...if i make it list then the list shows but the background disappears.
please find my code attached...i'm not a professional programmer.
tabla.txt
-
18 Sep 2012 7:46 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
Use the Chrome or Safari dev tools to check out the DOM. You need to push yourself to learn how to debug things
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.
-
18 Sep 2012 8:30 AM #5
This is one of the tabs in which the background shows. this is xtype panel.
Code:<div class="x-container x-panel x-layout-card-item x-item-hidden" id="ext-home-1" style="background-image: url(http://localhost/323/tabla/resources/images/bg.png); background-size: cover; display: none !important; background-position: 50% 50%; background-repeat: repeat repeat; ">
this is for the list in which the background doesnt work
and thisCode:<div class="x-container x-panel x-layout-card-item" id="ext-Bollist-1" style="">
i tried editing the divs for the list by adding the same style as the first for the background. but as usual the list disappears. and the background still doesnt show up...Code:<div class="x-container x-list-normal x-list x-list-ungrouped x-layout-fit-item" id="ext-list-1">
-
18 Sep 2012 10:32 AM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
- Answers
- 83
Why would you even want to do this? I've never seen an app that had a special background image for a list. Color maybe. image? no.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
18 Sep 2012 11:23 AM #7


Reply With Quote