Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Where to put AJAX call in users-search.js?


Where would I put the ajax search function inside users-search.js? It would return a php page containing the data-kt-search-element="results"

"use strict";
var KTModalUserSearch = function() {
var e, t, n, s, a, r = function(e) {
setTimeout((function() {
var a = KTUtil.getRandomInt(1, 3);
t.classList.add("d-none"), 3 === a ? (n.classList.add("d-none"), s.classList.remove("d-none")) : (n.classList.remove("d-none"), s.classList.add("d-none")), e.complete()
}), 1500)
},
o = function(e) {
t.classList.remove("d-none"), n.classList.add("d-none"), s.classList.add("d-none")
};
return {
init: function() {
(e = document.querySelector("#kt_modal_users_search_handler")) && (e.querySelector('[data-kt-search-element="wrapper"]'), t = e.querySelector('[data-kt-search-element="suggestions"]'), n = e.querySelector('[data-kt-search-element="results"]'), s = e.querySelector('[data-kt-search-element="empty"]'), (a = new KTSearch(e)).on("kt.search.process", r), a.on("kt.search.clear", o))
}
}
}();
KTUtil.onDOMContentLoaded((function() {
KTModalUserSearch.init()
}));


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Nvm figured it out happy thank you!



Where would I take that src file? Would I copy / paste it into the KTLayoutSearch function in scripts.bundle.js??



Hi,

You can refer to this post.

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(