Matt Simoncavage
Posts: 0
Joined: Thu Jun 04, 2015 7:10 pm

Search component run service

I'm using the search component on a page to run a query service. The little clear button that appears when you start typing only clears the text in the search component. I have a second query service set up to clear results on the page. My question is, can I use javascript to run this service when I click the clear button? And if so, what is the script. I tried the following:

( ".ui-input-clear" ).on( "click", function() {
clear_service.execute();
});

Where 'clear_service' is the name of the service I want to run, but nothing happened.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Search component run service

Hello Matt,

Please use JS below on page show event:

pre$( ".ui-input-clear" ).off( "click");
$( ".ui-input-clear" ).on( "click", function() {
clear_service.execute();
});/pre

Matt Simoncavage
Posts: 0
Joined: Thu Jun 04, 2015 7:10 pm

Search component run service

Thanks Sergiy, that worked.

Return to “Issues”