Skip to content
Snippets Groups Projects
Commit a629dec1 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Run the jslint checker.

parent 34c3ce7b
No related branches found
No related tags found
2 merge requests!6Master,!57 preferences
...@@ -11,7 +11,7 @@ Ext.define('App.grid.property.Preferences', { ...@@ -11,7 +11,7 @@ Ext.define('App.grid.property.Preferences', {
alias: 'widget.xpreferences', alias: 'widget.xpreferences',
/** /**
* @cfg {String} dbtable * @cfg {String} dbtable (required)
* The database table containing the property and their values * The database table containing the property and their values
*/ */
dbtable: "preferences", dbtable: "preferences",
...@@ -55,7 +55,7 @@ Ext.define('App.grid.property.Preferences', { ...@@ -55,7 +55,7 @@ Ext.define('App.grid.property.Preferences', {
minWidth: 80, minWidth: 80,
text: me.textUpdate, text: me.textUpdate,
scope: me scope: me
},{ }, {
handler: me.onButtonReset, handler: me.onButtonReset,
minWidth: 80, minWidth: 80,
text: me.textReset, text: me.textReset,
...@@ -76,8 +76,6 @@ Ext.define('App.grid.property.Preferences', { ...@@ -76,8 +76,6 @@ Ext.define('App.grid.property.Preferences', {
// initialise the base class // initialise the base class
me.callParent(arguments); me.callParent(arguments);
// link the buttons
// load the store and fill the grid property // load the store and fill the grid property
me.refStore.load({ me.refStore.load({
callback: me.onRefStoreLoad, callback: me.onRefStoreLoad,
...@@ -89,19 +87,19 @@ Ext.define('App.grid.property.Preferences', { ...@@ -89,19 +87,19 @@ Ext.define('App.grid.property.Preferences', {
* load the store and fill the grid property * load the store and fill the grid property
* *
*/ */
onRefStoreLoad: function(records, operation, success) { onRefStoreLoad: function (records, operation, success) {
"use strict"; "use strict";
var me = this, var me = this,
data = {}, data = {};
i, property, value;
for (i = 0; i < records.length; i += 1) { records.forEach(function (record) {
property = records[i].get(me.fieldProperty); var property, value;
value = records[i].get(me.fieldValue); property = record.get(me.fieldProperty);
value = record.get(me.fieldValue);
data[property] = value; data[property] = value;
} });
me.setSource(data, me.sourceConfig); me.setSource(data, me.sourceConfig);
}, },
...@@ -125,17 +123,15 @@ Ext.define('App.grid.property.Preferences', { ...@@ -125,17 +123,15 @@ Ext.define('App.grid.property.Preferences', {
"use strict"; "use strict";
var me = this, var me = this,
data = me.getSource(), data = me.getSource(),
i, newValue, oldValue, properties, record; properties = Object.keys(data);
// the list of property
properties = Object.keys(data);
// find the record associate to each property // find the record associate to each property
// update it if necessarily // update it if necessarily
for (i = 0; i < properties.length; i += 1) { properties.forEach(function (property) {
record = me.refStore.findRecord(me.fieldProperty, properties[i]); var newValue, oldValue, record;
record = me.refStore.findRecord(me.fieldProperty, property);
newValue = data[properties[i]]; newValue = data[property];
oldValue = record.get(me.fieldValue); oldValue = record.get(me.fieldValue);
if (newValue !== oldValue) { if (newValue !== oldValue) {
...@@ -143,7 +139,7 @@ Ext.define('App.grid.property.Preferences', { ...@@ -143,7 +139,7 @@ Ext.define('App.grid.property.Preferences', {
record.set(me.fieldValue, newValue); record.set(me.fieldValue, newValue);
record.endEdit(); record.endEdit();
} }
} });
// close the window housing the preferences widget // close the window housing the preferences widget
// simple logic based on the owner container // simple logic based on the owner container
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment