PDA

View Full Version : EXTJS Scope



rajuarien
30 Sep 2013, 8:35 AM
What the difference between the following code snippets as regarding the "scope" attribute

Case #1
======
xtype: "button",
id: 'searchButton',
style: 'margin-left:50px',
name: 'searchButton',
text: "Search",
listeners: {
'click': function () {

//End saving data to cookies
},
scope: this
} //End Listeners


Case #2
======
xtype: "button",
id: 'searchButton',
style: 'margin-left:50px',
name: 'searchButton',
text: "Search",
scope: this,
listeners: {
'click': function () {

//End saving data to cookies
}
} //End Listeners

ettavolt
30 Sep 2013, 10:39 AM
First is scope for listeners, second is scope for handler function, that can be configured for button.