As per i know alternateClassName is helpful to call one class with diffrent names and we can use the actions as per class name.
The below code will be helpful for you:
Ext.define('Sample', {
alternateClassName: ['Example', 'Important'],
code: function(msg) {
alert('Sample for alternateClassName... ' + msg);
},
renderTo :document.body
});
var hi = Ext.create('Sample');
hi.code('Sample');
var hello = Ext.create('Example');
hello.code('Example');
var imp = Ext.create('Important');
imp.code('Important');
In the above code,you can find the things like:
1.We are using three names called Sample,Example,Important for one class.
2.We can use the action i.e., alert message according to the class name.
3.We are displaying the alert message based on the class name.Here we are displaying the alert message for showing the result.But we can write some actions according to the class name like,if we want to create one button and we need to write action on the button as per class name then this will be helpful.
You can fint the working sample below:
http://jsfiddle.net/kesamkiran/kVbra/30/