xtype: 'Separator',
xns: Roo.Toolbar
},
+ {
+ xtype: 'Button',
+ xns: Roo.Toolbar,
+ listeners : {
+ toggle : function (_self, pressed)
+ {
+
+ this.setText(pressed ? "Hide Inactive" : "Show Inactive");
+ (function() { _this.grid.footer.onClick('first'); }).defer(100);
+ },
+ render : function (_self)
+ {
+ _this.active = _self;
+ }
+ },
+ enableToggle : true,
+ text : "Show Inactive"
+ },
+ {
+ xtype: 'Fill',
+ xns: Roo.Toolbar
+ },
{
xtype: 'Button',
xns: Roo.Toolbar,
text : "Add",
icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
},
- {
- xtype: 'Separator',
- xns: Roo.Toolbar
- },
{
xtype: 'Button',
xns: Roo.Toolbar,
listeners : {
- toggle : function (_self, pressed)
- {
-
- this.setText(pressed ? "Hide Inactive" : "Show Inactive");
- (function() { _this.grid.footer.onClick('first'); }).defer(100);
- },
- render : function (_self)
+ click : function()
{
- _this.active = _self;
+ var s = _this.grid.getSelectionModel().getSelected();
+
+ if(!s || s.data.vend_id * 1 < 1){
+ Roo.MessageBox.alert('Error', 'Please select a row');
+ return;
+ }
+
+ Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete that?",
+ function(v) {
+ if (v != 'yes') {
+ return;
+ }
+ new Pman.Request({
+ method: 'POST',
+ url: baseURL+ '/Roo/vendinfo',
+ params : {
+ _delete : s.data.vend_id
+ },
+ success : function() {
+ _this.grid.footer.onClick('refresh');
+ }
+ });
+ });
}
},
- enableToggle : true,
- text : "Show Inactive"
- },
- {
- xtype: 'Fill',
- xns: Roo.Toolbar
+ cls : 'x-btn-text-icon',
+ text : "Delete",
+ icon : rootURL + '/Pman/templates/images/trash.gif'
},
{
xtype: 'Button',
width : 100,
renderer : function(v) { return String.format('{0}', v); }
},
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ dataIndex : 'vend_vendtype_id_vendtype_descrip',
+ header : 'Type',
+ width : 150,
+ renderer : function(v) { return String.format('{0}', v); }
+ },
{
xtype: 'ColumnModel',
xns: Roo.grid,