Not sure if anyone still needs the answer to this question. I came here through Google trying to figure out how to do just this. Found the answer in Ext.window.MessageBox documentation.
If you allow for a third parameter in your callback function, the config object passed to the show method is passed to the callback. You can put anything you like in that object and then access it in the callback function.
Here's a snippet of my code with the variable names generalized.
Code:
var intThingId = button.up().up().getSelectionModel().getSelection()[0].get('intThingId');
Ext.Msg.show({
title: 'Proceed?',
msg: 'You are about to do this thing. Are you sure?',
buttons: Ext.Msg.YESNO,
fn: processResult,
icon: Ext.window.MessageBox.QUESTION,
myController: this,
intThingId: intThingId
});
function processResult(button, whateverThisIsIDoNotKnow, configObj) {
if (button == 'yes') {
console.log('yes button clicked');
configObj.myController.getSomeStore().load({ params: JSON.stringify({ intThingId: configObj.intThingId }) });
} else {
console.log('else');
}
};