Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / api / Ext.util.CSS.html
1 <!DOCTYPE html><html><head><title>Ext.util.CSS | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
2 <style type="text/css">.head-band { display: none; }
3 .header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
4 .doc-tab .members .member a.more { background-color: #efefef; }
5 </style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
6 </head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit 
7 <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">
8
9     req = {
10         liveURL: '.',
11         standAloneMode: true,
12         origDocClass: 'Ext.util.CSS',
13         docClass: 'Ext.util.CSS',
14         docReq: 'Ext.util.CSS',
15         version: '4.0',
16         baseURL: '.',
17         baseDocURL: '.',
18         baseProdURL: '.'
19     };
20
21     clsInfo = {};
22
23
24
25 </script>
26
27 <script type="text/javascript" src="../search.js"></script>
28 <!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
29 <script type="text/javascript" src="../class_tree.js"></script>
30 <script type="text/javascript" src="../class_doc.js"></script>
31 <script type="text/javascript">
32     req.source = 'CSS.html#Ext-util.CSS';
33     clsInfo = {"methods":["createStyleSheet","getRule","getRules","refreshCache","removeStyleSheet","swapStyleSheet","updateRule"],"cfgs":[],"properties":[],"events":[],"subclasses":[]};
34     Ext.onReady(function() {
35         Ext.create('Docs.classPanel');
36     });
37 </script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/CSS.html#Ext-util.CSS" target="_blank">Ext.util.CSS</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><p>Utility class for manipulating CSS rules</p>
38 <div class="members"><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-createStyleSheet" class="member f ni"><a href="Ext.util.CSS.html#method-createStyleSheet" rel="method-createStyleSheet" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-createStyleSheet" class="viewSource">view source</a></div><a name="createStyleSheet"></a><a name="method-createStyleSheet"></a><a href="Ext.util.CSS.html#" rel="method-createStyleSheet" class="cls expand">createStyleSheet</a>(
39 <span class="pre">String cssText, String id</span>)
40  : StyleSheet</div><div class="description"><div class="short">Creates a stylesheet from a text blob of rules.
41 These rules will be wrapped in a STYLE tag and appended to the HEAD o...</div><div class="long"><p>Creates a stylesheet from a text blob of rules.
42 These rules will be wrapped in a STYLE tag and appended to the HEAD of the document.</p>
43 <h3 class="pa">Parameters</h3><ul><li><span class="pre">cssText</span> : String<div class="sub-desc"><p>The text containing the css rules</p>
44 </div></li><li><span class="pre">id</span> : String<div class="sub-desc"><p>An id to add to the stylesheet for later removal</p>
45 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">StyleSheet</span>&nbsp; &nbsp;
46 </li></ul></div></div></div><div id="method-getRule" class="member ni"><a href="Ext.util.CSS.html#method-getRule" rel="method-getRule" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-getRule" class="viewSource">view source</a></div><a name="getRule"></a><a name="method-getRule"></a><a href="Ext.util.CSS.html#" rel="method-getRule" class="cls expand">getRule</a>(
47 <span class="pre">String/Array selector, Boolean refreshCache</span>)
48  : CSSRule</div><div class="description"><div class="short"><p>Gets an an individual CSS rule by selector(s)</p>
49 </div><div class="long"><p>Gets an an individual CSS rule by selector(s)</p>
50 <h3 class="pa">Parameters</h3><ul><li><span class="pre">selector</span> : String/Array<div class="sub-desc"><p>The CSS selector or an array of selectors to try. The first selector that is found is returned.</p>
51 </div></li><li><span class="pre">refreshCache</span> : Boolean<div class="sub-desc"><p>true to refresh the internal cache if you have recently updated any rules or added styles dynamically</p>
52 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">CSSRule</span>&nbsp; &nbsp;<p>The CSS rule or null if one is not found</p>
53 </li></ul></div></div></div><div id="method-getRules" class="member ni"><a href="Ext.util.CSS.html#method-getRules" rel="method-getRules" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-getRules" class="viewSource">view source</a></div><a name="getRules"></a><a name="method-getRules"></a><a href="Ext.util.CSS.html#" rel="method-getRules" class="cls expand">getRules</a>(
54 <span class="pre">Boolean refreshCache</span>)
55  : Object</div><div class="description"><div class="short"><p>Gets all css rules for the document</p>
56 </div><div class="long"><p>Gets all css rules for the document</p>
57 <h3 class="pa">Parameters</h3><ul><li><span class="pre">refreshCache</span> : Boolean<div class="sub-desc"><p>true to refresh the internal cache</p>
58 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Object</span>&nbsp; &nbsp;<p>An object (hash) of rules indexed by selector</p>
59 </li></ul></div></div></div><div id="method-refreshCache" class="member ni"><a href="Ext.util.CSS.html#method-refreshCache" rel="method-refreshCache" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-refreshCache" class="viewSource">view source</a></div><a name="refreshCache"></a><a name="method-refreshCache"></a><a href="Ext.util.CSS.html#" rel="method-refreshCache" class="cls expand">refreshCache</a> : Object</div><div class="description"><div class="short"><p>Refresh the rule cache if you have dynamically added stylesheets</p>
60 </div><div class="long"><p>Refresh the rule cache if you have dynamically added stylesheets</p>
61 <h3 class="pa">Returns</h3><ul><li><span class="pre">Object</span>&nbsp; &nbsp;<p>An object (hash) of rules indexed by selector</p>
62 </li></ul></div></div></div><div id="method-removeStyleSheet" class="member ni"><a href="Ext.util.CSS.html#method-removeStyleSheet" rel="method-removeStyleSheet" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-removeStyleSheet" class="viewSource">view source</a></div><a name="removeStyleSheet"></a><a name="method-removeStyleSheet"></a><a href="Ext.util.CSS.html#" rel="method-removeStyleSheet" class="cls expand">removeStyleSheet</a>(
63 <span class="pre">String id</span>)
64  : void</div><div class="description"><div class="short"><p>Removes a style or link tag by id</p>
65 </div><div class="long"><p>Removes a style or link tag by id</p>
66 <h3 class="pa">Parameters</h3><ul><li><span class="pre">id</span> : String<div class="sub-desc"><p>The id of the tag</p>
67 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
68 </li></ul></div></div></div><div id="method-swapStyleSheet" class="member ni"><a href="Ext.util.CSS.html#method-swapStyleSheet" rel="method-swapStyleSheet" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-swapStyleSheet" class="viewSource">view source</a></div><a name="swapStyleSheet"></a><a name="method-swapStyleSheet"></a><a href="Ext.util.CSS.html#" rel="method-swapStyleSheet" class="cls expand">swapStyleSheet</a>(
69 <span class="pre">String id, String url</span>)
70  : void</div><div class="description"><div class="short"><p>Dynamically swaps an existing stylesheet reference for a new one</p>
71 </div><div class="long"><p>Dynamically swaps an existing stylesheet reference for a new one</p>
72 <h3 class="pa">Parameters</h3><ul><li><span class="pre">id</span> : String<div class="sub-desc"><p>The id of an existing link tag to remove</p>
73 </div></li><li><span class="pre">url</span> : String<div class="sub-desc"><p>The href of the new stylesheet to include</p>
74 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
75 </li></ul></div></div></div><div id="method-updateRule" class="member ni"><a href="Ext.util.CSS.html#method-updateRule" rel="method-updateRule" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.CSS.html" class="definedIn docClass">Ext.util.CSS</a><br/><a href="../source/CSS.html#Ext-util.CSS-method-updateRule" class="viewSource">view source</a></div><a name="updateRule"></a><a name="method-updateRule"></a><a href="Ext.util.CSS.html#" rel="method-updateRule" class="cls expand">updateRule</a>(
76 <span class="pre">String/Array selector, String property, String value</span>)
77  : Boolean</div><div class="description"><div class="short"><p>Updates a rule property</p>
78 </div><div class="long"><p>Updates a rule property</p>
79 <h3 class="pa">Parameters</h3><ul><li><span class="pre">selector</span> : String/Array<div class="sub-desc"><p>If it's an array it tries each selector until it finds one. Stops immediately once one is found.</p>
80 </div></li><li><span class="pre">property</span> : String<div class="sub-desc"><p>The css property</p>
81 </div></li><li><span class="pre">value</span> : String<div class="sub-desc"><p>The new value for the property</p>
82 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Boolean</span>&nbsp; &nbsp;<p>true If a rule was found and updated</p>
83 </li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>