},
{
"listeners": {
- "|click": "function()\n{\n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete all the address?\",\n function(v) {\n if (v != 'yes') {\n return;\n }\n new Pman.Request({\n method: 'POST',\n url: baseURL+ '/Roo/vendaddrinfo',\n params : {\n vendaddr_id : s.data.vendaddr_id,\n _deleteAll : 1\n },\n success : function() {\n _this.agrid.footer.onClick('refresh');\n }\n });\n });\n}\n "
+ "|click": "function()\n{\n var s = _this.form.findField('vend_id').getValue() * 1;\n \n if(!s || s * 1 < 1){\n Roo.MessageBox.alert('Error', 'Save first!');\n return;\n }\n \n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete all the address?\",\n function(v) {\n if (v != 'yes') {\n return;\n }\n new Pman.Request({\n method: 'POST',\n url: baseURL+ '/Roo/vendinfo',\n params : {\n vendaddr_vend_id : s,\n _deleteAll : 1\n },\n success : function() {\n _this.agrid.footer.onClick('refresh');\n }\n });\n });\n}\n "
},
"cls": "x-btn-text-icon",
"text": "Delete All",
listeners : {
click : function()
{
+ var s = _this.form.findField('vend_id').getValue() * 1;
+
+ if(!s || s * 1 < 1){
+ Roo.MessageBox.alert('Error', 'Save first!');
+ return;
+ }
+
Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete all the address?",
function(v) {
if (v != 'yes') {
}
new Pman.Request({
method: 'POST',
- url: baseURL+ '/Roo/vendaddrinfo',
+ url: baseURL+ '/Roo/vendinfo',
params : {
- vendaddr_id : s.data.vendaddr_id,
+ vendaddr_vend_id : s,
_deleteAll : 1
},
success : function() {