Author: bleny Date: 2014-05-16 10:55:59 +0200 (Fri, 16 May 2014) New Revision: 1946 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1946 Log: init filter values Modified: trunk/wao-web/src/main/webapp/wao.js Modified: trunk/wao-web/src/main/webapp/wao.js =================================================================== --- trunk/wao-web/src/main/webapp/wao.js 2014-05-15 16:11:05 UTC (rev 1945) +++ trunk/wao-web/src/main/webapp/wao.js 2014-05-16 08:55:59 UTC (rev 1946) @@ -292,6 +292,21 @@ this.filterModel.filter[this.filterMapping.filterName] = filterValue; } + this.init = function () { + var filterValues = WAO.getNestedPropertyValue(this.filterMapping.filterName, this.filterModel); + if (filterValues) { + var selectedOptions = []; + $.each(filterValues, function (index, filterValue) { + selectedOptions.push({ + value: filterValue, + // TODO brendan 16/05/14 get label + label: filterValue, + }); + }); + this.selectedOptions = selectedOptions; + } + } + }; var OneFilterView = function (oneFilterModel) { @@ -387,6 +402,7 @@ this.init = function () { + this.model.init(); this.view.init(); this.view.$select.change(function () {