KavitaC
KavitaC

Reputation: 635

ExtJS setTitle() doesn't update the panel title

I have a panel as follows:

Ext.define('TestPanel', {
  extend: 'Ext.panel.Panel',
  alias: 'widget.testPanel',
id: 'testerPanel',
title: 'oldTilte',
//other code
});

I have a controller of a different view where I wish to update the panel title:

var grid = Ext.getCmp('testerPanel');
grid.setTitle('newTitle'); //doesn't update the title

//tried with including ref or view in the controller
this.getTestPanel().setTitle('newTitle'); //this didn't update it either

How can I update the panel title? Also for both above tries, if I print the console.info(grid) or console.info(this.getTestPanel()), I always see the updated title in the console output but the UI itself remains unchanged

Upvotes: 1

Views: 2762

Answers (1)

Hard Developer
Hard Developer

Reputation: 319

Check out the below Jsfiddle Demo for your requirement its is working.I have made the Grid with initial having title. Grid toolbar contains one button 'Change Title' click to see your required solution.

this.up('grid').setTitle('New Grid Title');

Here is the working Demo for Above : http://jsfiddle.net/PhAbR/83/

Upvotes: 1

Related Questions