19115564cc748a95894e81cd63e8d59cc6d5699815cf0f61d3867988713207548222614c77bb02ba755b61b80b518323be32c33c30facac959f9fb8e174932 800 B

1234567891011121314151617181920212223242526272829
  1. import AutocompleteEditor from './autocompleteEditor';
  2. import Hooks from './../pluginHooks';
  3. /**
  4. * @private
  5. * @editor DropdownEditor
  6. * @class DropdownEditor
  7. * @dependencies AutocompleteEditor
  8. */
  9. class DropdownEditor extends AutocompleteEditor {
  10. prepare(row, col, prop, td, originalValue, cellProperties) {
  11. super.prepare(row, col, prop, td, originalValue, cellProperties);
  12. this.cellProperties.filter = false;
  13. this.cellProperties.strict = true;
  14. }
  15. }
  16. Hooks.getSingleton().add('beforeValidate', function(value, row, col, source) {
  17. let cellMeta = this.getCellMeta(row, this.propToCol(col));
  18. if (cellMeta.editor === DropdownEditor) {
  19. if (cellMeta.strict === void 0) {
  20. cellMeta.filter = false;
  21. cellMeta.strict = true;
  22. }
  23. }
  24. });
  25. export default DropdownEditor;