pre_values.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * Copyright (c) UNA, Inc - https://una.io
  3. * MIT License - https://opensource.org/licenses/MIT
  4. * @defgroup Tasks Tasks
  5. * @ingroup UnaModules
  6. *
  7. * @{
  8. */
  9. function BxTasksPreValues(oOptions)
  10. {
  11. BxBaseModTextManageTools.call(this, oOptions);
  12. this._sObjName = oOptions.sObjName == undefined ? 'oBxTasksPreValues' : oOptions.sObjName;
  13. this._sPageUrl = oOptions.sPageUrl == undefined ? '' : oOptions.sPageUrl;
  14. }
  15. BxTasksPreValues.prototype = Object.create(BxBaseModTextManageTools.prototype);
  16. BxTasksPreValues.prototype.constructor = BxTasksPreValues;
  17. BxTasksPreValues.prototype.onChangeList = function(oElement) {
  18. var sList = $(oElement).val();
  19. document.location.href = this._sPageUrl + (sList.length > 0 ? '&list=' + sList : '');
  20. };
  21. BxTasksPreValues.prototype.onChangeFilter = function(oFilter) {
  22. var $this = this;
  23. var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
  24. var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
  25. if(sValueSearch == _t('_sys_grid_search'))
  26. sValueSearch = '';
  27. clearTimeout($this._iSearchTimeoutId);
  28. $this._iSearchTimeoutId = setTimeout(function () {
  29. glGrids[$this._sObjNameGrid].setFilter(sValueSearch, true);
  30. }, 500);
  31. };
  32. /** @} */