Problems with search box (ver4.2.23)

General issues related to the use of Metro 4
Post Reply
winnet
Posts: 3
Joined: Tue Sep 25, 2018 10:02 am
Status: Offline

Problems with search box (ver4.2.23)

Post by winnet » Tue Sep 25, 2018 10:20 am

Hi, the metro ui is cool and we have replaced bootstrap with Metro 4 on all projects.
However, the version 4.2.23 has changed the code of "search box" and the "data-on-search-button-click" event can not be triggered correctly!
I have read the guide on "Components - Forms - Search" very carefully and can not figure out how to make it work.
I have tried the following code, but none of these is working.

<input type="text" data-role="input" data-search-button="true" data-search-button-click="button" data-on-search-button-click="alert('clicked!')" />
<input type="text" data-role="input" data-search-button="true" data-search-button-click="submit" data-on-search-button-click="alert('clicked!')" />
<input type="text" data-role="input" data-search-button="true" data-on-search-button-click="alert('clicked!')" />



Please tell me if there is something wrong as we have already upgraded all the on-going projects!

Thanks in advance! The Metro 4 is perfect!

User avatar
olton
Site Admin
Posts: 115
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Tue Sep 25, 2018 10:47 am


winnet
Posts: 3
Joined: Tue Sep 25, 2018 10:02 am
Status: Offline

Post by winnet » Tue Sep 25, 2018 11:41 am

Thank you for your reply!
I have tested the following new code, but only "submit func" works.
The custom function doesn't work for now.
Please note that I have added "data-search-button=true" in the example.

<script>
function mySubmitSearch(val){
alert('Custom submit function');
}
</script>
<form action="javascript:" onsubmit="alert('Form submit with self function');">
<p>Custom func</p>
<input type="text" data-role="input"
data-search-button-click="custom"
data-search-button="true"
data-on-search-button-click="mySubmitSearch">

<p>Form submit func</p>
<input type="text" data-search-button="true" data-role="input">
</form>

User avatar
olton
Site Admin
Posts: 115
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Tue Sep 25, 2018 11:51 am

Thank you! I fix it in 4.2.24

winnet
Posts: 3
Joined: Tue Sep 25, 2018 10:02 am
Status: Offline

Post by winnet » Tue Sep 25, 2018 11:58 am

olton wrote:
Tue Sep 25, 2018 11:51 am
Thank you! I fix it in 4.2.24
Metro UI is great! Waiting for your new release!

User avatar
olton
Site Admin
Posts: 115
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Tue Sep 25, 2018 12:11 pm

You can get develop branch :) from https://github.com/olton/Metro-UI-CSS/tree/4.2.24 and not wait for release.

Post Reply