I have the following code:
function handlesomeObjDelete(someObj) {
query('#someObj-delete-link-'+someObj.id).on('click',function(){
var youSureDlg = new Dialog({
title: 'Delete someObj',
width:'250px',
id:'delete-someObj-dlg'+someObj.id,
content:'Are you sure you want to delete this someObj?'
});
var yesBtn = new Button({
label: 'Yes',
type: "button"
});
var noBtn = new Button({
label: 'No',
type: "button"
});
on(yesBtn,'click',function(){
request("someUrl/"+someObj.id, {
handleAs: "json",
type:'delete',
headers: {
"X-Requested-With": "",
"Content-Type": 'application/json; charset=utf-8'
}
}).then(function(){
alert('deleted');
});
});
on(noBtn,'click',function(){
youSureDlg.hide();
});
yesBtn.placeAt(youSureDlg);
noBtn.placeAt(youSureDlg);
//youSureDlg.startup();
youSureDlg.show();
});
}
And I get the following error:
TypeError: refNode is null
packs[name] = packageInfo;
TypeError: youSureDlg.show is not a function
dojoSniffConfig
I have included dijit.Dialog. If I try to create the Dialog again I get: Tried to register widget with id==someid but that id is already registered
Any idea of what could be wrong?
Thanks.