cls : 'x-btn-text-icon',
text : "Add",
icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
+ },
+ {
+ xtype: 'Button',
+ xns: Roo.Toolbar,
+ listeners : {
+ click : function ()
+ {
+ var cs = _this.grid.getSelectionModel().getSelectedCell();
+
+ if (!cs) {
+ Roo.MessageBox.alert("Error", "Select a cell");
+ return;
+ }
+ _this.grid.stopEditing();
+
+ var r = _this.grid.ds.getAt(cs[0]);
+
+ Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete this metric?", function (v){
+ if (v != 'yes') {
+ return;
+ }
+
+ new Pman.Request({
+ url : baseURL + '/Roo/Metric',
+ method : 'POST',
+ params : {
+ _delete : r.data.id
+ },
+ success : function(res) {
+ _this.grid.footer.onClick('refresh');
+ }
+ });
+ });
+ }
+ },
+ cls : 'x-btn-text-icon',
+ text : "Remove",
+ icon : rootURL + '/Pman/templates/images/trash.gif'
}
]
},