PDA

View Full Version : [Solved] Ext.form.TextField and CSS.



cluettr
4 Aug 2007, 10:16 AM
Hi, I'm looking to apply css to a TextField. I've got my code below. I must be missing something :)



<style type="text/css">
.search_box {
border: 1px solid #7B9EBD;
margin: 0px;
padding: 2px;
width: 125px;
height: 13px;
font-size: 11px;
color: #666666;
font-family: arial;
background-image: url('../_images_backgrounds/bkg_search.gif');
background-repeat: repeat-x;
background-position:left bottom;
}

</style>




<script>
var search = new Ext.form.TextField({
cls: "search_box"
});

search.addListener('specialkey',
function () {
var sval = search_form.search.value
Grid_rma_listing.searchReconfigure(sval);
});

search.applyTo('search');
</script>

cluettr
5 Aug 2007, 10:53 AM
I figured this out... for the most part... you need to add "!important" to the end of any css statement which you want to use as an overide... at least I beleive this to be the case. I didn't put too much effort into digging up the reasons but this may be helpful:

http://www.w3.org/TR/REC-CSS2/cascade.html#important-rules