manage_tools.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Copyright (c) UNA, Inc - https://una.io
  3. * MIT License - https://opensource.org/licenses/MIT
  4. *
  5. * @defgroup Groups Groups
  6. * @ingroup UnaModules
  7. *
  8. * @{
  9. */
  10. function BxGroupsManageTools(oOptions) {
  11. this._sActionsUrl = oOptions.sActionUrl;
  12. this._sObjNameGrid = oOptions.sObjNameGrid;
  13. this._sObjName = oOptions.sObjName == undefined ? 'oBxGroupsManageTools' : oOptions.sObjName;
  14. this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
  15. this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
  16. this._sParamsDivider = oOptions.sParamsDivider == undefined ? '#-#' : oOptions.sParamsDivider;
  17. this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
  18. this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
  19. }
  20. BxGroupsManageTools.prototype.onChangeFilter = function(oFilter) {
  21. var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
  22. var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
  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. glGrids[this._sObjNameGrid].setFilter(sValueFilter1 + this._sParamsDivider + sValueSearch, true);
  28. };
  29. BxGroupsManageTools.prototype.onClickSettings = function(sMenuObject, oButton) {
  30. if($(oButton).hasClass('bx-btn-disabled'))
  31. return false;
  32. bx_menu_popup(sMenuObject, oButton, {}, {
  33. content_id: $(oButton).attr('bx_grid_action_data')
  34. });
  35. };
  36. BxGroupsManageTools.prototype.onClickDelete = function(iContentId) {
  37. $('.bx-popup-applied:visible').dolPopupHide();
  38. glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
  39. };
  40. BxGroupsManageTools.prototype.onClickDeleteWithContent = function(iContentId) {
  41. $('.bx-popup-applied:visible').dolPopupHide();
  42. glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete_with_content', {}, '', false, 1);
  43. };
  44. /** @} */