extjs - Why does insertHTML('text') render as "undefined"? -
when execute following extjs code, shows me "undefined" instead of text want insert div.

result

how insert html extjs element?
<!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"> <style type="text/css"> body { padding: 20px; } div#message { margin: 10px 0 0 0; } </style> <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext/ext-all-debug.js"></script> <title>simple extjs</title> <script type="text/javascript"> ext.blank_image_url = 'ext/resources/images/default/s.gif'; ext.onready(function() { console.info('check see if shows in firebug'); ext.get('buttoninfo').on('click', function() { var message = ext.get('message'); message.inserthtml('this information'); }); }); </script> </head> <body> <button id="buttoninfo">info</button> <div id="message"></div> </body> </html> @flo, if use innerhtml not recognized on extjs object:

more attempts didn't work

edit: sorry, missed important bits of question. don't know extjs, i'm afraid.
i'm still wondering if wouldn't simpler use regular dom, seems you're trying achieve anyway:
var x=document.getelementbyid("message"); x.innerhtml = 'this information'; edit2: after bit of searching, came this:
var message = ext.get('message'); ext.domhelper.inserthtml('afterbegin', message, 'this information'); edit3: answer mess, here go:
ext.domhelper.inserthtml('afterbegin', message.dom, 'this information'); or
message.update('text');
Comments
Post a Comment