partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 62e2456c107a6d0bbeef257d8c436fe782c41be4
parent 4079157f9e1ac6c6c0a200c84ef805a1bdb92523
Author: Felicitus <felicitus@felicitus.org>
Date:   Mon,  3 Aug 2015 15:03:08 +0200

Added footprint object and renderer to the parts grid

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js | 12++++++++++--
Msrc/PartKeepr/PartBundle/Entity/Part.php | 2+-
2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js @@ -282,8 +282,7 @@ Ext.define('PartKeepr.PartsGrid', { renderer: this.averagePriceRenderer }, { header: i18n("Footprint"), - dataIndex: 'footprintName', - renderer: Ext.util.Format.htmlEncode + renderer: this.footprintRenderer }, { header: i18n("Category"), dataIndex: 'categoryPath', @@ -305,6 +304,15 @@ Ext.define('PartKeepr.PartsGrid', { return rec.getStorageLocation().get("name"); }, /** + * Renders the storage location + */ + footprintRenderer: function (val, q, rec) + { + if (rec.getFootprint()) { + return rec.getFootprint().get("name"); + } + }, + /** * Used as renderer for the stock level columns. * * If a part contains a non-default unit, we display it. diff --git a/src/PartKeepr/PartBundle/Entity/Part.php b/src/PartKeepr/PartBundle/Entity/Part.php @@ -52,7 +52,7 @@ class Part extends BaseEntity /** * The footprint of this part * @ORM\ManyToOne(targetEntity="PartKeepr\FootprintBundle\Entity\Footprint") - * + * @Groups({"default"}) * @var Footprint */ private $footprint;