commit f12c0235ebc834db88c62077e726c321b75daf11
parent 1f16c65c144f1aa29cca6ca1a87a61b4d0b540c2
Author: Felicia Hummel <felicitus@felicitus.org>
Date: Wed, 17 Aug 2016 14:11:50 +0200
Merge pull request #717 from partkeepr/PartKeepr-682
Bugfix for #682
Diffstat:
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartDisplay.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartDisplay.js
@@ -68,7 +68,7 @@ Ext.define('PartKeepr.PartDisplay', {
this.addButton = new Ext.Button({
text: i18n("Add Stock"),
iconCls: 'web-icon brick_add',
- handler: Ext.bind(this.addPartPrompt, this)
+ handler: Ext.bind(this.addPartStockPrompt, this)
});
/**
@@ -77,7 +77,7 @@ Ext.define('PartKeepr.PartDisplay', {
this.deleteButton = new Ext.Button({
text: i18n("Remove Stock"),
iconCls: 'web-icon brick_delete',
- handler: Ext.bind(this.deletePartPrompt, this)
+ handler: Ext.bind(this.removePartStockPrompt, this)
});
/**
@@ -195,15 +195,15 @@ Ext.define('PartKeepr.PartDisplay', {
/**
* Prompt the user for the stock level he wishes to add.
*/
- addPartPrompt: function ()
+ addPartStockPrompt: function ()
{
var j = new PartKeepr.PartStockWindow({partUnitName: this.record.get("partUnitName")});
- j.addStock(this.addPartHandler, this);
+ j.addStock(this.addStockHandler, this);
},
/**
* Callback after the "add stock" dialog is complete.
*/
- addPartHandler: function (quantity, price, comment)
+ addStockHandler: function (quantity, price, comment)
{
this.record.callPutAction("addStock", {
quantity: quantity,
@@ -214,15 +214,15 @@ Ext.define('PartKeepr.PartDisplay', {
/**
* Prompts the user for the stock level to decrease for the item.
*/
- deletePartPrompt: function ()
+ removePartStockPrompt: function ()
{
var j = new PartKeepr.PartStockWindow({partUnitName: this.record.get("partUnitName")});
- j.removeStock(this.deletePartHandler, this);
+ j.removeStock(this.removeStockHandler, this);
},
/**
* Callback after the "delete stock" dialog is complete.
*/
- deletePartHandler: function (quantity, unused_price, comment)
+ removeStockHandler: function (quantity, unused_price, comment)
{
this.record.callPutAction("removeStock", {
quantity: quantity,
diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsManager.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsManager.js
@@ -161,6 +161,12 @@ Ext.define('PartKeepr.PartManager', {
this.grid.getSelectionModel().select(parts);
}, this);
+ this.grid.store.on("update", function (store, record) {
+ if (this.detail.record !== null && this.detail.record.getId() == record.getId()) {
+ this.detail.setValues(record);
+ }
+ }, this);
+
this.grid.store.on("load", function () {
this.thumbnailView.getStore().removeAll();