Skip to content

Commit

Permalink
Merge pull request #4085 in SW/shopware from sw-16379/5.2/revert-chan…
Browse files Browse the repository at this point in the history
…ges to 5.2

* commit '21efff73cc1a07cce930918735dfaa1a0c41a628':
  Revert "Shopware.grid.Panel - Save Record after editing with roweditor"
  Revert "Move record.save to seperate function"
  Revert "Validate if model has create or update action"
  • Loading branch information
MarcelSchmaeing committed Oct 5, 2016
2 parents f30a6a9 + 21efff7 commit acfa080
Showing 1 changed file with 4 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ Ext.define('Shopware.grid.Panel', {
/**
* Event fired after the grid columns created. This event can be used
* to add additional column over the Ext JS event system.
*
*
* @param { Shopware.grid.Panel } grid - Instance of this component.
* @param { Array } columns - The filled columns array contains all generated columns.
*/
Expand Down Expand Up @@ -1119,7 +1119,7 @@ Ext.define('Shopware.grid.Panel', {
}

me.fireEvent(me.eventAlias + '-before-create-columns', me, columns);

if (me.getConfig('rowNumbers')) {
columns.push(me.createRowNumberColumn());
}
Expand Down Expand Up @@ -1397,12 +1397,7 @@ Ext.define('Shopware.grid.Panel', {

if (me.getConfig('rowEditing')) {
me.rowEditor = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 2,
listeners: {
edit: function (editor, e) {
me.saveRecord(e.record);
}
}
clicksToEdit: 2
});
items.push(me.rowEditor)
}
Expand All @@ -1411,23 +1406,6 @@ Ext.define('Shopware.grid.Panel', {

return items;
},

/**
* @param record Ext.data.Model
*/
saveRecord: function(record) {
var me = this;

if (!record) {
return;
}
if (!me.hasModelAction(record, 'update') && !me.hasModelAction(record, 'create')) {
return;
}
try {
record.save();
} catch (e) { }
},

/**
* Creates all required grid features for a default shopware listing.
Expand Down Expand Up @@ -1880,4 +1858,4 @@ Ext.define('Shopware.grid.Panel', {
}
});

//{/block}
//{/block}

0 comments on commit acfa080

Please sign in to comment.