Jump to content

Selectize.js modules family


Macrura

Recommended Posts

@Macrura - I haven't used this before, but just tried on a PW latest dev install and I am seeing this browser error:

selectize.js:2230 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
    at Selectize.refreshOptions (selectize.js:2230)
    at Selectize.onFocus (selectize.js:1752)
    at selectize.js:2088

Please let me know if you have problems reproducing and I'll dig a little deeper.

Thanks.

Link to comment
Share on other sites

these are errors in the vendor library, which is PW core, so nothing i can do to fix it; Only possibility is that your JS in the field settings has an error.  I'm not getting any console errors with any pages running selectize inputfields, or any image fields using tags (which also use the PW core selectize.js).

Link to comment
Share on other sites

  • 11 months later...

I'm not sure if this is the correct place, but I'm looking for a way to make a select dropdown to choose a file have a similar behavior like selectize.js.

In particular, when adding/editing a link in a CKEditor Textarea to link a document (in the opening Modal) I would like to be able to start typing and not have to go through a huge list to select from the dropdown with all the files:

image.thumb.png.6eedba54c7bcaffc8dcabb5134708036.png

Is there a way to have existing select-fields in the PW Admin with a selectize.js feature so you can start typing to filter the list? Can this module (or some in the family) help with this?

Link to comment
Share on other sites

Hey - cool suggestion; Since Selectize.js is part of the core, this seems like a job for a new module (or hook) – the module/hook would basically initiate the selectize.js assets to be added to the page, as well as a custom js file that would initialize selectize on that field. If I have some time I'll take a look at it..

  • Like 1
Link to comment
Share on other sites

On 2/7/2022 at 10:45 PM, bernhard said:

We already have the TextTags field that is great for picking files:

Interesting, I didn't know about this. But to my understanding I can use this field to create a new field in the admin page which is awesome but not exactly what I'm looking for.

Is it possible to replace existing (default) option dropdowns (like choosing a file in CKEditor) with such a TextTags field?

Link to comment
Share on other sites

4 hours ago, joeck said:

Is it possible to replace existing (default) option dropdowns (like choosing a file in CKEditor) with such a TextTags field?

Yes. You can modify every inputfield in the PW backend via hooks:

$wire->addHookAfter("Inputfield(name=link_page_file)::render", function($event) {
  $html = $event->return;
  $html .= " hooked";
  $event->return = $html;
});

image.png.43b7027fa61f90587dddedd778851963.png

  • Like 1
Link to comment
Share on other sites

Is there a simple code example for using module with a simple Options list (one per line)? I don’t need fancy visuals. I’d just like to use this module because of its search capability. All I want to do is search the list I entered in the Options field.

Options
-----
Option A
Option B
Option C

UPDATE: Disregard. I figured it out.

Edited by fuzenco
Answered my own question
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...