PDA

View Full Version : [CLOSED] set window's title problem



hdsoso
Oct 08, 2013, 3:52 PM
there is a window on a page, when set its'title from code behind


w_add.Title = "修改文章";

then , set its's title from js


var showAddWindow = function() {
App.w_add.title = '新增文章';
App.w_add.show();
};

but the window's title dose not change. why?

blueworld
Oct 08, 2013, 4:01 PM
You could try:



App.w_add.setTitle('新增文章');

Baidaly
Oct 08, 2013, 10:41 PM
Hello!

Yes, @blueworld is right. To change the title of already rendered (not hidden, rendered) window you should use method setTitle: http://docs-origin.sencha.com/extjs/4.2.1/#!/api/Ext.panel.Panel-method-setTitle

hdsoso
Oct 08, 2013, 11:51 PM
Hello!

Yes, @blueworld is right. To change the title of already rendered (not hidden, rendered) window you should use method setTitle: http://docs-origin.sencha.com/extjs/4.2.1/#!/api/Ext.panel.Panel-method-setTitle
if the window is closed by clicked close button, how to change its's title?

Baidaly
Oct 09, 2013, 1:10 AM
The logic should be the same. However, check what value is in closeAction property. It should be Hide: http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.window.Window-cfg-closeAction