Пример #1
0
        private void DestroyAutocomplete()
        {
            if (!_applied)
            {
                return;
            }
            _applied = false;
            AutocompleteService.Unregister(AutocompleteId);
            var code = $"LaraUI.autocompleteDestroy('{InnerInput.Id}');";

            LaraUI.Page.JSBridge.Submit(code);
        }
Пример #2
0
        private void SubmitAutocomplete(Document document, AutocompleteOptions options)
        {
            AutocompleteId = GetAutocompleteKey(document);
            AutocompleteService.Register(AutocompleteId, this);
            _applied = true;
            _pending = false;
            var payload = new AutocompletePayload
            {
                AutoFocus = options.AutoFocus,
                ElementId = InnerInput.EnsureElementId(),
                MinLength = options.MinLength,
                Strict    = options.Strict
            };
            var json = LaraUI.JSON.Stringify(payload);
            var code = $"LaraUI.autocompleteApply(context.Payload);";

            LaraUI.Page.JSBridge.Submit(code, json);
        }