What is the best way to replace ExtJS-generated DOM elements with new ExtJS elements? -


i making php/extjs framework generates base extjs javascript on first page visit, via ajax calls manipulates dom.

so need able replace specific dom elements created extjs new dom elements created extjs.

in following example, want replace text in region_center 2 panels.

however, renderto adds element, while applyto replaces content prevents me added e.g. 2 panels since second 1 replaces first one.

how can manipulate extjs-generated javascript can replace regions of screen new content, e.g. in menu in 1 clicks on panels , center_region replaced new content?

<!doctype html> <html>     <head>         <meta http-equiv="content-type" content="text/html; charset=utf-8">         <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css">         <script type="text/javascript" src="ext/adapter/ext/ext-base.js">         </script>         <script type="text/javascript" src="ext/ext-all-debug.js">         </script>         <script type="text/javascript" src="js/jquery-1.4.4.min.js">         </script>         <title>test of renderto</title>         <script type="text/javascript">             ext.onready(function(){                 new ext.panel({                     id: 'new_content1',                     renderto: 'region_center',                     title: 'the title',                     margins: '10 10 10 10',                     html: 'content1 added extjs'                 });                 new ext.panel({                     id: 'new_content2',                     renderto: 'region_center',                     title: 'the title',                     margins: '10 10 10 10',                     html: 'content2 added extjs'                 });             });         </script>     </head>     <body>         <h1 class="main">test of renderto:</h1>         <div id="region_center" class=" x-panel x-border-panel" style="left: 220px; top: 43px; width: 1478px;">             <div class="x-panel-bwrap" id="ext-gen9">                 <div class="x-panel-body x-panel-body-noheader" id="ext-gen10" style="padding: 10px; overflow: auto; width: 1456px; height: 620px;">                     original text , should replaced                 </div>             </div>         </div>     </body></html> 

all classes extending ext.container (ext.panel included) have add() method can use append new components, remove() removing them.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -