arma-server-web-admin/public/js/app/views/missions/list.js
2019-07-25 10:43:29 +02:00

28 lines
796 B
JavaScript

define(function (require) {
"use strict";
var $ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
Marionette = require('marionette'),
ListItemView = require('app/views/missions/list_item'),
tpl = require('text!tpl/missions/list.html'),
template = _.template(tpl);
return Marionette.CompositeView.extend({
childView: ListItemView,
childViewContainer: "tbody",
template: template,
initialize: function (options) {
this.filterValue = options.filterValue;
},
filter: function (child, index, collection) {
return child.get('name').toLowerCase().indexOf(this.filterValue.toLowerCase()) >= 0;
},
});
});