Hi, before migrate to alpha2 in 0.33 I had to add a label to a toolbar this code
var feedtb = new Ext.Toolbar('mystatus-tb');
.....
var lbUserLogged = document.getElementById('lbUsername');
feedtb.add(lbUserLogged);
now in alpha2 get this error
el has no properties
http://localhost/asfa/ext-all.js
Line 110
I was trying var lbUserLogged = Ext.get('lbUsername'); but the same, so how I can do it now from alpha2?
kind regards
Frank
var feedtb = new Ext.Toolbar('mystatus-tb');
.....
var lbUserLogged = document.getElementById('lbUsername');
feedtb.add(lbUserLogged);
now in alpha2 get this error
el has no properties
http://localhost/asfa/ext-all.js
Line 110
I was trying var lbUserLogged = Ext.get('lbUsername'); but the same, so how I can do it now from alpha2?
kind regards
Frank

|
#2
|
|
It works the same. That error means the element you are passing doesn't exist.
Try this: var lbUserLogged = document.getElementById('lbUsername'); alert(lbUserLogged); ![]() |
|
#3
|
|
Jack you are right is null, but with 0.33 it work, now I move the label and work
<div id="status" class="x-layout-inactive-content"> <div id="hello-user" style="VISIBILITY: hidden"> <ASP:Label id="lbUsername" runat="server">Userlogged</ASP:Label> </div> <div id="mystatus-tb" style="MARGIN-TOP: -11px"> </div> </div> the var lbUserLogged = document.getElementById('lbUsername'); don't work when the component is inside the toolbar I mean: <div id="status" class="x-layout-inactive-content"> <div id="hello-user" style="VISIBILITY: hidden"> </div> <div id="mystatus-tb" style="MARGIN-TOP: -11px"> <ASP:Label id="lbUsername" runat="server">Userlogged</ASP:Label> </div> </div> I wrote it becouse I don't know if correct it or is a trouble in ext1 kind regards Frank ![]() |
用户在从ExtJS 0.33版本迁移到Alpha2时遇到问题,无法将标签添加到工具栏中。尝试使用`document.getElementById`和`Ext.get`获取元素均未成功,错误提示元素不存在。

被折叠的 条评论
为什么被折叠?



