ui.list.edit.search.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * DevExtreme (ui/list/ui.list.edit.search.js)
  3. * Version: 19.1.16
  4. * Build date: Tue Oct 18 2022
  5. *
  6. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  7. * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
  8. */
  9. "use strict";
  10. var ListEdit = require("./ui.list.edit");
  11. var searchBoxMixin = require("../widget/ui.search_box_mixin");
  12. var ListSearch = ListEdit.inherit(searchBoxMixin).inherit({
  13. _addWidgetPrefix: function(className) {
  14. return "dx-list-" + className
  15. },
  16. _getCombinedFilter: function() {
  17. var filter;
  18. var storeLoadOptions;
  19. var dataSource = this._dataSource;
  20. if (dataSource) {
  21. storeLoadOptions = {
  22. filter: dataSource.filter()
  23. };
  24. dataSource._addSearchFilter(storeLoadOptions);
  25. filter = storeLoadOptions.filter
  26. }
  27. return filter
  28. },
  29. _initDataSource: function() {
  30. var value = this.option("searchValue");
  31. var expr = this.option("searchExpr");
  32. var mode = this.option("searchMode");
  33. this.callBase();
  34. if (this._dataSource) {
  35. value && value.length && this._dataSource.searchValue(value);
  36. mode.length && this._dataSource.searchOperation(searchBoxMixin.getOperationBySearchMode(mode));
  37. expr && this._dataSource.searchExpr(expr)
  38. }
  39. }
  40. });
  41. module.exports = ListSearch;