From 48487c230b7b06ea86469df91cf0330686bb7800 Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Fri, 19 Feb 2016 19:59:04 -0500 Subject: [PATCH] js: Add Security Description field --- js/AccountsTab.js | 6 +++--- js/models.js | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/js/AccountsTab.js b/js/AccountsTab.js index 6dadf0c..af6b899 100644 --- a/js/AccountsTab.js +++ b/js/AccountsTab.js @@ -128,8 +128,8 @@ const AddEditAccountModal = React.createClass({ item.Name + " - " + item.Description} + defaultValue={this.state.security} onChange={this.handleSecurityChange} ref="security" /> @@ -141,7 +141,7 @@ const AddEditAccountModal = React.createClass({ data={AccountTypeList} valueField='TypeId' textField='Name' - value={this.state.type} + defaultValue={this.state.type} onChange={this.handleTypeChange} ref="type" /> diff --git a/js/models.js b/js/models.js index 665b3a6..f9955dd 100644 --- a/js/models.js +++ b/js/models.js @@ -90,6 +90,7 @@ for (var type in SecurityType) { function Security() { this.SecurityId = -1; this.Name = ""; + this.Description = ""; this.Symbol = ""; this.Precision = -1; this.Type = -1; @@ -99,6 +100,7 @@ Security.prototype.toJSON = function() { var json_obj = {}; json_obj.SecurityId = this.SecurityId; json_obj.Name = this.Name; + json_obj.Description = this.Description; json_obj.Symbol = this.Symbol; json_obj.Precision = this.Precision; json_obj.Type = this.Type; @@ -112,6 +114,8 @@ Security.prototype.fromJSON = function(json_input) { this.SecurityId = json_obj.SecurityId; if (json_obj.hasOwnProperty("Name")) this.Name = json_obj.Name; + if (json_obj.hasOwnProperty("Description")) + this.Description = json_obj.Description; if (json_obj.hasOwnProperty("Symbol")) this.Symbol = json_obj.Symbol; if (json_obj.hasOwnProperty("Precision"))