This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.pluck(_productCollection.Items, "Id"), function (Id) { | |
return Id === product.Id; | |
}) | |
_productCollection = { | |
CriteriaType: "Products", | |
Items: { | |
Facility: null, | |
FacilityId: null, | |
Name: "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
removeFacilitySpecificItemsFromGrid = function (facilityId) { | |
var | |
bindingStorageElement = $('#ProductNames'), | |
productCollection = $(bindingStorageElement).data('products'), | |
newSelectionsParent = {}, | |
newSelections = []; | |
if (productCollection !== undefined) { | |
$.each(productCollection.Items, function (key, item) { | |
if (item.FacilityId !== facilityId.toString()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
removeContractProfileFromGrid = function (event) { | |
var | |
contractProfileId = $(event.currentTarget).parent().data('dataKey'), | |
contractProfileRecord = _contractProfileGridRecords.get(contractProfileId); | |
_contractProfileGridRecords.remove(contractProfileRecord); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_contracts = new _widgetCollections.Contracts(); | |
_contractDropDown = new _widgetViews.contractDropDown({ | |
collection: _contracts | |
}); | |
And in a seperate file this is the collection definition: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backbone.Collection = function (models, options) { | |
options || (options = {}); | |
if (options.comparator) { | |
this.comparator = options.comparator; | |
delete options.comparator; | |
} | |
this._boundOnModelEvent = _.bind(this._onModelEvent, this); | |
this._reset(); | |
if (models) this.refresh(models, { silent: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// events simply proxy through. | |
_onModelEvent : function(ev, model) { | |
if (ev === 'change:id') { | |
delete this._byId[model.previous('id')]; | |
this._byId[model.id] = model; | |
} | |
this.trigger.apply(this, arguments); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (models) { | |
models.Contract = Backbone.Model.extend({ | |
Value: "", | |
Text: "" | |
}); | |
}(widgets.models = widgets.models || {})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modeling | |
{ | |
"Operator": "", | |
"ColumnName": "", | |
"Value": "", | |
"RelationshipToPreviousSibling": "", | |
"Attributes": { | |
"ModelId": "3e267d46-343b-4f76-9774-3537d425f3e5" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search.View = Backbone.View.extend({ | |
events: { | |
"keydown input": "search" | |
}, | |
search: function(event) { | |
var o = {}; | |
_.extend(o,Backbone.Events); | |
o.trigger('route:search'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search.View = Backbone.View.extend({ | |
events: { | |
"keydown input": "search" | |
}, | |
search: function(event) { | |
this.trigger('search',"myq"); | |
} | |
}); |