diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js index cbebb280cb..85c1ebc7be 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js @@ -5,122 +5,107 @@ $(function () { var getFormattedDate = function ($datePicker) { return $datePicker.data().datepicker.getFormattedDate('yyyy-mm-dd'); }; - + var comboboxItems = []; + service.getFilterItems() .then(function (result) { - comboboxItems = result; - fillOptions(); + comboboxItems = result; + fillOptions(); }).catch(function (error) { - abp.message.error(error); - }); + abp.message.error(error); + }); + + + var $projectId = $('#ProjectId'); + + $projectId.on('change', function () { + fillOptions(); + }); + + var comboboxs = { + version: $('#Version'), + languageCode: $('#LanguageCode'), + format: $('#Format') + }; + for (var key in comboboxs) { + comboboxs[key].on('change', function () { + fillOptions(); + }); + } + + + var selectedItem = getSelectedItem(); + + function emptyComboboxs() { + for (var key in comboboxs) { + comboboxs[key].empty(); + } + } + function getSelectedItem() { + var item = {}; + for (var key in comboboxs) { + item[key] = comboboxs[key].val(); + } + return item; + } - var $projectId = $('#ProjectId'); - var $version = $('#Version'); - var $languageCode = $('#LanguageCode'); - var $format = $('#Format'); + function SetComboboxsValues(item) { + for (var key in comboboxs) { + comboboxs[key].val(item[key]); + } + } + function addComboboxsEmptyItem() { + for (var key in comboboxs) { + comboboxs[key].append($('