Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\js\edeal\views\select.js
Views.Select = Views.Base.extend({ classType: "Views.Select", tagName: "div", listenEvents: function() { //See Views.Base listenDefaultEvents() this.on("oninitialize", this.onInitialize); this.on("onrender", this.onRender); }, triggerEventsOn: function() { //See Views.Base launchDefaultActionsOn() }, triggerAddModelToCollectionOn: function() { var that = this; this.on("onmodelchange", function(event) { that.trigger("onaddmodeltocollection"); }); }, hide: function(callback) { //this.$el.animate({height:'0px'}, 100, callback); var that = this; this.$el.slideUp(100, function() { if (callback) { callback(); } that.trigger("onhide"); }); this.options.isShowed = false; }, show: function(callback) { //this.$el.animate({height:'0px'}, 100, callback); var that = this; this.$el.slideDown(100, function() { if (callback) { callback(); } that.trigger("onshow"); }); this.options.isShowed = true; }, onInitialize: function() { if ((this.options.isrequired == false)) { if (this.options.possiblevalues) { if (!this.options.possiblevalues.getByProperty("value", "")) { var aPossibleValue = new Models.PossibleValue(); aPossibleValue.value = ""; aPossibleValue.label = ""; aPossibleValue.set("label", ""); this.options.possiblevalues.add(aPossibleValue, {at: 0}); } this.options.possiblevalues.setValueSelected(this.model.get("value")); var emptyPossibleValue = this.options.possiblevalues.getByProperty("value", ""); if (emptyPossibleValue) { emptyPossibleValue.label = ""; emptyPossibleValue.set("label", ""); } } } }, onRender: function() { $('option[value="' + this.model.get("value") + '"]', this.$el).attr('selected','selected'); //console.log(this.model); }, resetAddEl: function() { var addAction = this.options.parentview.options.actions.add; var authorizedouble = addAction.authorizedouble; if (!authorizedouble) { this.resetEl(true); var aSelect = this.$el; if (this.options.parentview.model.length >= this.options.possiblevalues.length - 1) { this.hide(); } else { this.show(); } } this.$el.val(""); $('option[value=""]', this.$el).html(edApplication().labels.LABELSELECTAVALUE); }, resetEl: function(isAddEl) { var addAction = this.options.parentview.options.actions.add; var authorizedouble = addAction.authorizedouble; if (!authorizedouble) { var selectedValues = new Array(); this.options.parentview.model.each(function(item) { selectedValues.push(item.get("value")); }); var options = ""; for (var i=0; i<this.options.possiblevalues.length; i++) { options += "<option value='" + this.options.possiblevalues.models[i].get("value") + "'>" + this.options.possiblevalues.models[i].get("label") + "</option>"; } var aSelect = this.$el; var currentVal = aSelect.val(); $('option', aSelect).remove(); aSelect.append(options); $("option[value='" + currentVal + "']", aSelect).attr('selected','selected'); for (var j=0; j<selectedValues.length; j++) { if (currentVal != selectedValues[j]) { $('option[value=' + selectedValues[j] + ']', aSelect).remove(); } } if (!isAddEl) { //$('option[value=""]', aSelect).html(edApplication().labels.LABELRESETTHEVALUE); $('option[value=""]', aSelect).remove(); } } }, //return a Model.Value getModelValueFromInput: function(aString) { var aModelValue = this.model; aModelValue.set("value", aString); var aPossibleValue = this.options.possiblevalues.getByProperty("value", aString); if (aPossibleValue) { aModelValue.set("label", aPossibleValue.get("label")); } return aModelValue; } }); Views.SelectList = Views.BaseList.extend({ classType: "Views.SelectList", listenEvents: function() { //See Views.Base listenDefaultEvents() this.on("oninitialize", this.onInitialize); this.on("onremovemodelfromcollection ", function() { this.resetEl(); }); this.on("onrenderlist", function() { this.resetEl(); }); }, onInitialize: function() { if (!this.options.actions) { this.options.actions = {}; } if (!this.options.actions.add) { this.options.actions.add = {}; } if (!this.options.actions.remove) { this.options.actions.remove = {}; } if (!this.options.actions.remove.button) { this.options.actions.remove.button = {}; } this.options.actions.add.active = true; //this.options.actions.add.authorizedouble = true; this.options.actions.remove.active = true; this.options.actions.remove.button.position = { my: "right center", at: "right-15 center", collision: "none" }; if (!this.options.actions.sort) { this.options.actions.sort = {}; this.options.actions.sort.active = false; } if (!this.options.actions.sort.button) { this.options.actions.sort.button = {}; } this.options.actions.sort.button.position = { my: "left center", at: "left center", collision: "none" }; }, resetEl: function() { var that = this; var addAction = this.options.actions.add; var authorizedouble = addAction.authorizedouble; if (addAction.view) { addAction.view.resetAddEl(); } this.model.each(function(item) { var view = item.view; if (view) { if (!authorizedouble) { view.resetEl(); } //$('option[value=""]', view.$el).html(edApplication().labels.LABELRESETTHEVALUE); view.$el.on("change", function(event) { that.resetEl(); }); } }); } });
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de