partkeepr

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

commit ae5409237e7e0bd88366a0399051e414d037a562
parent d8ade1f1115eaecfcb5c5f4b4a7a5c14b60c0335
Author: Felicitus <felicitus@felicitus.org>
Date:   Mon,  8 Jun 2015 17:48:10 +0200

Use record.get("name") instead of getRecordName, as getRecordName is deprecated

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Editor/Editor.js | 6+++---
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Editor/EditorComponent.js | 8++++----
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Footprint/FootprintTree.js | 4++--
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Printing/PrintingJobConfigurationEditor.js | 4++--
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Unit/UnitEditor.js | 12+++++-------
5 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Editor/Editor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Editor/Editor.js @@ -25,7 +25,7 @@ Ext.define('PartKeepr.Editor', { // @todo Finish implementing the dirty flag later /*if (this.change == false) { - this.setTitle(this.record.getRecordName() + "*"); + this.setTitle(this.record.get("name") + "*"); } this.change = true;*/ @@ -83,8 +83,8 @@ Ext.define('PartKeepr.Editor', { this.record = record; this.getForm().loadRecord(this.record); this.show(); - if (this.record.getRecordName() !== "") { - this._setTitle(this.record.getRecordName()); + if (this.record.get("name") !== "") { + this._setTitle(this.record.get("name")); } this.change = false; diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Editor/EditorComponent.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Editor/EditorComponent.js @@ -103,12 +103,12 @@ Ext.define('PartKeepr.EditorComponent', { } // Still here? OK, we don't have an editor open. Create a new one - var model = Ext.data.schema.Schema.get(this.model); - + var model = Ext.ClassManager.get(this.model); + model.load(id, { scope: this, success: function(record, operation) { - editor = this.createEditor(record.getRecordName()); + editor = this.createEditor(record.get("name")); editor.editItem(record); this.editorTabPanel.add(editor).show(); } @@ -144,7 +144,7 @@ Ext.define('PartKeepr.EditorComponent', { var recordName; if (r.getRecordName) { - recordName = r.getRecordName(); + recordName = r.get("name"); } else { recordName = r.get("name"); } diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Footprint/FootprintTree.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Footprint/FootprintTree.js @@ -130,8 +130,8 @@ Ext.define("PartKeepr.FootprintTree", { for (var i=0;i<store.getCount();i++) { record = store.getAt(i); nodeData = { - text: record.getRecordName(), - name: record.getRecordName(), + text: record.get("name"), + name: record.get("name"), id: record.get("id"), leaf: true, iconCls:'icon-footprint' diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Printing/PrintingJobConfigurationEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Printing/PrintingJobConfigurationEditor.js @@ -92,8 +92,8 @@ Ext.define('PartKeepr.Printing.PrintingJobConfigurationEditor', { this.record = record; this.getForm().loadRecord(this.record); this.show(); - if (this.record.getRecordName() !== "") { - this._setTitle(this.record.getRecordName()); + if (this.record.get("name") !== "") { + this._setTitle(this.record.get("name")); } this.change = false; diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Unit/UnitEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Unit/UnitEditor.js @@ -15,7 +15,7 @@ Ext.define('PartKeepr.UnitEditor', { columns: [ { text: i18n("Prefix"), dataIndex: "prefix", width: 60 }, { text: i18n("Symbol"), dataIndex: "symbol", width: 60 }, - { text: i18n("Power"), dataIndex: "power", flex: 1, renderer: function (val) { return "10<sup>"+val+"</sup>"; } } + { text: i18n("Power"), dataIndex: "exponent", flex: 1, renderer: function (value) { return "10<sup>"+value+"</sup>"; } } ] }); @@ -39,6 +39,7 @@ Ext.define('PartKeepr.UnitEditor', { this.callParent(); this.on("startEdit", this.onStartEdit, this); + this.on("itemSave", this.onItemSave, this); }, onStartEdit: function () { var records = this.record.prefixes().getRange(); @@ -49,9 +50,8 @@ Ext.define('PartKeepr.UnitEditor', { for (var i=0;i<records.length;i++) { toSelect.push(pfxStore.getAt(pfxStore.find("id", records[i].get("id")))); } - - // @todo I don't like defer too much, can we fix that somehow? - Ext.defer(function () { this.gridPanel.getSelectionModel().select(toSelect); }, 100, this); + + this.gridPanel.getSelectionModel().select(toSelect); }, onItemSave: function () { var selection = this.gridPanel.getSelectionModel().getSelection(); @@ -59,9 +59,7 @@ Ext.define('PartKeepr.UnitEditor', { this.record.prefixes().removeAll(true); for (var i=0;i<selection.length;i++) { - this.record.prefixes().add({id: selection[i].get("id") }); + this.record.prefixes().add(selection[i]); } - - this.callParent(); } });