ottscho
Goto Top

ExtJS - Grid- Datensatz löschen

Nabend,

ich versuche mich gerade an einem Backendplugin für ein Shopsystem.
Dies nutzt ExtJS und ich lerne mich hier im Moment etwas ein.
ich habe auch schon ein Grid erstellt, welches mir meine Datensätze aus der DB anzeigt.
Nun hätte ich einfach gerne hinter jeder Row im Grid ein x Icon um den Datensatz/Row zu löschen.

Ich habe schon einge Beispiele gesehen aber bekomme es irgendwie nicht hin. Vllt hat von euch jmd eine Idee:

<script>
 
Ext.ns('Shopware.Plugins.OttschoPartnerSystem');  
 
Shopware.Plugins.OttschoPartnerSystem.Grid =  Ext.extend(Ext.grid.GridPanel,
{	
	region:'center',  
	title:'Übersicht',  
	id:'grid',  
	renderTo:'table',  
	initComponent: function() {
	  	this.initStore();
	  	this.initColumnModel();
	    Shopware.Plugins.OttschoPartnerSystem.Grid.superclass.initComponent.call(this);
	},
	initStore: function(){
		this.store = new Ext.data.Store({
	        url: '{url action=getUnions}' ,  
	        reader: new Ext.data.JsonReader({
	            root: 'items',  
	            totalProperty: 'total'  
	        }, [
	            { name: 'customernumber'},{ name: 'unionname'},  
				{ name: 'unioncode'},{ name: 'percentage'},  
	            { name: 'publicview'},{ name: 'firstname'},{ name: 'lastname'}  
 
	        ])
	    });
	    this.store.load();
	},
	initColumnModel: function(){
		 this.columns = [
         	{
                xtype: 'gridcolumn',  
                dataIndex: 'customernumber',  
                header: 'KDNR',  
                sortable: true,
                width: 60
	     },
        	{
                xtype: 'gridcolumn',  
                dataIndex: 'unionname',  
                header: 'Verein',  
                sortable: true,
                width: 150
            },
		{
                xtype: 'gridcolumn',  
                dataIndex: 'firstname',  
                header: 'Vorname',  
                sortable: false,
                width: 120
	     },
	     {
                xtype: 'gridcolumn',  
                dataIndex: 'lastname',  
                header: 'Nachname',  
                sortable: false,
                width: 120
	     },
        	{
                xtype: 'gridcolumn',  
                dataIndex: 'unioncode',  
                header: 'Verein-Code',  
                sortable: false,
                width: 150
	    },
        	{
                xtype: 'gridcolumn',  
                dataIndex: 'percentage',  
                header: 'Porzentsatz',  
                sortable: false,
                width: 80
            },
        	{
                xtype: 'gridcolumn',  
                dataIndex: 'publicview',  
                header: 'sichtbar',  
                sortable: false,
                width: 60
	     }
	];
	}
});


(function(){
	View = Ext.extend(Ext.Viewport, {
		layout: 'border',  
		initComponent: function() {
			this.items = [new Shopware.Plugins.OttschoPartnerSystem.Grid()];
	        View.superclass.initComponent.call(this);
		}
	});
	Shopware.Plugins.OttschoPartnerSystem.View = View;
})();;
 
 
Ext.onReady(function(){
	Ext.QuickTips.init();
	Example = new Shopware.Plugins.OttschoPartnerSystem.View();
});

</script>

Vielen Dank

Content-Key: 169609

Url: https://administrator.de/contentid/169609

Printed on: April 18, 2024 at 07:04 o'clock