flyingman
3 Dec 2009, 9:16 AM
Where is the function deleteDocument in Version 3? InVersion 2 it has work.
deleteDocument is not a function, when I click the 'delete'-key in a view.
This code is only in Beta 2 not in Beta 3 (extnd-all-debug.js):
// private
deleteDocument: function(grid, rowIndex, e) {
var ds = grid.getStore();
var row = grid.selModel.getSelected();
var node = row.node;
var unid = node.attributes.getNamedItem('unid');
// if a unid does not exist this row is a category so bail
if (!unid) {
return;
} else {
unid = unid.value;
}
var deleteDocUrl = this.viewUrl + '/' + unid + '?DeleteDocument';
var docExists = (this.tabPanel) ? this.tabPanel.findById("pnl-" + unid) : null;
if (docExists) {
Ext.MessageBox.alert("Delete Error","You have this document open in another tab. Please close the document first before deleting.");
} else {
Ext.Ajax.request({
method: 'GET',
disableCaching: true,
success : this.gridDeleteDocumentSuccess,
failure : this.gridDeleteDocumentFailure,
row: row,
scope: this,
url: deleteDocUrl
});
}
}
Thanks
Roland
deleteDocument is not a function, when I click the 'delete'-key in a view.
This code is only in Beta 2 not in Beta 3 (extnd-all-debug.js):
// private
deleteDocument: function(grid, rowIndex, e) {
var ds = grid.getStore();
var row = grid.selModel.getSelected();
var node = row.node;
var unid = node.attributes.getNamedItem('unid');
// if a unid does not exist this row is a category so bail
if (!unid) {
return;
} else {
unid = unid.value;
}
var deleteDocUrl = this.viewUrl + '/' + unid + '?DeleteDocument';
var docExists = (this.tabPanel) ? this.tabPanel.findById("pnl-" + unid) : null;
if (docExists) {
Ext.MessageBox.alert("Delete Error","You have this document open in another tab. Please close the document first before deleting.");
} else {
Ext.Ajax.request({
method: 'GET',
disableCaching: true,
success : this.gridDeleteDocumentSuccess,
failure : this.gridDeleteDocumentFailure,
row: row,
scope: this,
url: deleteDocUrl
});
}
}
Thanks
Roland