i have a view with a search select filter from a rel' parent CPT name 'cities'.
the view output a select with options from a CPT 'streets' filtered by the parent 'city' filter.
the 2 select elements is upgraded with custom js (using toolset_select2()) using the js editor in the filter section.
the 2 selections update 2 hidden select cred fields in a CRED form.
i used the shortcodes on a page content and it works 🙂 great.
when i use the shortcodes on a content template of elementor that opened thrgh ajax popup loader or call the page content using ajax call to the template "the_content" my view and form doesn't init proper, noor does the included js editor code scripts (on the view's filter js editor) - scripts are not in the DOM
the view filter select element and the "auto ajax update" doesn't work or initiated
if i use elementor with JET popup addon, using the view/forms widget to add the form and the view to the popup template - it doesn't work as well and i also get an extra text :
"This is the preview of the "Streets Select Field filtered by Cities" View."
===== >>>>
how can i make sure that toolset code and elements\views\forms will work, render and initiated (the js mechanism behind it) properly when:
called by custom ajax (into a modal-popup)
or by ELEMENTOR toolset-widgets in an ELEMENTOR content-template of JET POPUP addon?
more info:
the custom ajax call i'm using to display posts\pages\CPTs-pages in a modal is limited to content inside a container (as in... <div id="modal-ready"> content </div>) or to "the_content" in a php template.
js document ready codes doesn't seems to run (well the doc is already "ready" so nothing is initialized)
can you help me please with checking why the view&form isn't rendering with proper init and included custom js from the view editor?
one of the things i thought about is using wp_enqueue_script (to enq some custom needed code) with a dep' of the toolset codes so when they will be forced to be enqueue then they will render and init the view and form properly - by adding the toolset scripts handles in the wp_enqueue_script dependency array :
----------------------- example --------------------------
/**
* Enqueue a script with JQUERY and TOOLSET libraries as a dependency.
*/
function toolset_scripts_method() {
wp_enqueue_script( 'custom-toolset-script', get_stylesheet_directory_uri() . '/js/custom_toolset_script.js', array( 'jquery','<???toolset view and cred init script handles???>' ) );
}
add_action( 'wp_enqueue_scripts', 'toolset_scripts_method' );