PDA

View Full Version : [1.0.1] bug in toolbar


nseb
04-30-2007, 03:01 PM
Hi,

I have a regression in toolbar , int nextBlock() method , tr has no properties. But with 1.0 , I have no problems.

Thanks for your reploy

justheatingup
04-30-2007, 03:12 PM
same here

MrKurt
04-30-2007, 03:17 PM
Same problem here, but it only happens on my paging toolbar in a grid. The other toolbar (one I set to the grid header) works fine.

I also see the error on this example: http://extjs.com/deploy/ext/examples/grid/paging.html

Hani
04-30-2007, 03:27 PM
This affects any subclasses of toolbar. The fix (well, my fix, which works for me!) is to add this line to the render call of the subclass:

Ext.PagingToolbar.superclass.render.apply(this, [el]);

Where PagingToolbar is the subclass name (modify if you have your own subclass).

feanor73
04-30-2007, 03:34 PM
Same problem here with PagingToolbar in 1.0.1 only.

It appears that Toolbar ctor() and render() was refactored, but PagingToolbar was not.

nseb
04-30-2007, 03:41 PM
I find the problem : is in Toolbar constructor when he's called with a Element object.

MD
04-30-2007, 07:44 PM
Same error here,

this.tr has no properties
[Break on this error] this.tr.appendChild(td);

jordansjones
04-30-2007, 08:36 PM
In PagingToolbar.js put the following as the first line in the render method
Ext.PagingToolbar.superclass.render.call(this, el);

This fixed it for me.

mystix
04-30-2007, 11:55 PM
yep @jordansjones, that works. thanks :)

ext-all-debug.js line 14041this.render(container);in the Toolbar superclass calls the PagingToolbar's render() method instead of the Toolbar superclass's own render() method, so the PagingToolbar's render() method gets called twice. scope problems?

dfenwick
05-01-2007, 02:19 AM
The initialization code for the toolbar was refactored to do initialization in the constructor and push the rendering to a render() function in Toolbar itself. Previously the constructor created the elements in the dom required for the toolbar. Now the creation of the dom elements happens in the render() function.

This wouldn't normally be a problem, but PagingToolbar provides a render() function of its own. Toolbar never had a render() function before, so this.render() calls the PagingToolbar render() function (as Mystix said.) The call to render() in Toolbar just needs to force itself to execute on its own class.

nseb
05-01-2007, 02:48 AM
I inspect code and I seen , after call constructor , tr initialized correctly , but while I add the first widget in toolbar , tr is null , I don't see why ?

This problem is only with while the toolbar called with a Element Object for container (not id) , Therefore PagingToolbar has problem too.

Best regards.

dragontree
05-01-2007, 09:02 AM
In PagingToolbar.js put the following as the first line in the render method
Ext.PagingToolbar.superclass.render.call(this, el);

This fixed it for me.

I added the line above and the same error occurs. Are there any other files that need to be modified?

mystix
05-01-2007, 09:34 AM
@dragontree, you'll need to add it to the render method in the ext-all-debug.js / ext-all.js file.

dfenwick
05-01-2007, 09:49 AM
There's a patch available for download now. It's been labeled 1.0.1a. Fixes this bug.

dragontree
05-01-2007, 09:52 AM
Thanks!

kubens
05-01-2007, 10:05 AM
I updated to 1.0.1a and now the Complex Layout example looks a little bit poor, because something went wrong with north region. It seems to be too small. You can see the same effect at the docu page :(

http://extjs.com/deploy/ext-1.0.1/docs/

Br
Wolfgang

feanor73
05-01-2007, 10:21 AM
1.0.1a fixes this problem for me. Thanks!

A note -> Be sure to use http://extjs.com/download for the download and NOT the link in the (now closed for posting) "Official Download" thread. The link in the thread points to the first 1.0.1 release.

kubens
05-01-2007, 10:31 AM
I did, because the problem with the north region was not there before and the paging toolbar error is gone with the wind :D Did you looked this page http://extjs.com/deploy/ext-1.0.1/docs/ and please do not forget to ensure that the js is not loaded from the cache :D

kubens
05-01-2007, 10:38 AM
I compared ext-all-debug.js.v1.0.1 with ext-all-debug.js.v1.0.1a and in the last file following line was removed:


Ext.LayoutRegion = function(mgr, config, pos){
Ext.LayoutRegion.superclass.constructor.call(this, mgr, config, pos, true);
var dh = Ext.DomHelper;

this.el = dh.append(mgr.el.dom, {tag: "div", cls: "x-layout-panel x-layout-panel-" + this.position}, true);


if(config.titlebar !== false){ <=== removed in 1.0.1a
this.titleEl = dh.append(this.el.dom, {tag: "div", unselectable: "on", cls: "x-unselectable x-layout-panel-hd x-layout-title-"+this.position, children:[
{tag: "span", cls: "x-unselectable x-layout-panel-hd-text", unselectable: "on", html: " "},
{tag: "div", cls: "x-unselectable x-layout-panel-hd-tools", unselectable: "on"}
]}, true);
this.titleEl.enableDisplayMode();

this.titleTextEl = this.titleEl.dom.firstChild;
this.tools = Ext.get(this.titleEl.dom.childNodes[1], true);
this.closeBtn = this.createTool(this.tools.dom, "x-layout-close");
this.closeBtn.enableDisplayMode();
this.closeBtn.on("click", this.closeClicked, this);
this.closeBtn.hide();
} <=== removed in 1.0.1a


Br
Wolfgang

nseb
05-01-2007, 12:28 PM
I have same error with 1.0.1a

with firebug this line in toolbar constuctor :

this.tr = this.el.child("tr", true);

return null,

I have the problem with firefox and IE7 , my container is directly a Element Object (div)

any idea ?

Thanks.

I inspect code and I seen , after call constructor , tr initialized correctly , but while I add the first widget in toolbar , tr is null , I don't see why ?

This problem is only with while the toolbar called with a Element Object for container (not id) , Therefore PagingToolbar has problem too.

Best regards.

dfenwick
05-01-2007, 12:40 PM
I have same error with 1.0.1a

with firebug this line in toolbar constuctor :

this.tr = this.el.child("tr", true);

return null,

I have the problem with firefox and IE7 , my container is directly a Element Object (div)

any idea ?

Thanks.

Did you clear your browser cache? Sounds like your last version was cached.

nseb
05-01-2007, 12:49 PM
Did you clear your browser cache? Sounds like your last version was cached.
yes , I clear my browser cache

Another information , the problem is in chid method in el Class:

1.0
child : function(selector, returnDom){
var n = Ext.DomQuery.selectNode(selector, this.dom);
return returnDom ? n : Ext.get(n);
}

1.0.1a
child : function(selector, returnDom){
var n = Ext.DomQuery.selectNode("#" + Ext.id(this.dom) + " " + selector);
return returnDom ? n : Ext.get(n);
},


I if replace 1.0.1a method with 1.0 version , it's work correctly.


The div container passed in toolbar constructor , is not yet attached at another element , maybe the problem ?

Best regards

Zakaroonikov
05-01-2007, 07:24 PM
I had extended the Toolbar and made a class similar to the PagingToolbar. In 1.0.0 the constructor called a routine called 'render' in 1.0.1 it now calls renderButtons I guess to prevent the override of the render function of the superclass.

The render function of the superclass creates the tr element. I hope that helps as it fixed it for me.

dfenwick
05-01-2007, 08:19 PM
I had extended the Toolbar and made a class similar to the PagingToolbar. In 1.0.0 the constructor called a routine called 'render' in 1.0.1 it now calls renderButtons I guess to prevent the override of the render function of the superclass.

The render function of the superclass creates the tr element. I hope that helps as it fixed it for me.

Yep. I spoke to Jack about this. It was the proper fix based on the new structure for Toolbar.

jgarcia@tdg-i.com
05-02-2007, 10:47 AM
Thanks for this thread. i was just about to post something because i ran into this today. :)

more ... ~o)

gensisns
05-02-2007, 12:50 PM
yes , I clear my browser cache

Another information , the problem is in chid method in el Class:

1.0
child : function(selector, returnDom){
var n = Ext.DomQuery.selectNode(selector, this.dom);
return returnDom ? n : Ext.get(n);
}

1.0.1a
child : function(selector, returnDom){
var n = Ext.DomQuery.selectNode("#" + Ext.id(this.dom) + " " + selector);
return returnDom ? n : Ext.get(n);
},


I if replace 1.0.1a method with 1.0 version , it's work correctly.


The div container passed in toolbar constructor , is not yet attached at another element , maybe the problem ?

Best regards

I am having this problem also - I have markup for a basicDialog: dialog, form child, header and body are childs of the form. Now when the basicDialog renders, it doesn't see my already created header and body, though it did before. It seems to be related to the change in the child function. Any suggestions?

nseb
05-02-2007, 01:05 PM
a quick release for fix this problem ?