olton / Metro-UI-CSS

Impressive component library for expressive web development! Build responsive projects on the web with the first front-end component library in Metro Style. And now there are even more opportunities every day!
http://metroui.org.ua/
MIT License
7.04k stars 1.96k forks source link

input btn-clear reloads the page #245

Closed codewode closed 9 years ago

codewode commented 11 years ago

Hi,

I am struggling to find why does my page reloads when i click btn-clear (small cross on the left of input box).

My page is partial view which is loaded on ajax call. Do i need to reinitiallize button.js?

regards, Burhan

olton commented 11 years ago

You can reinit all plugins for ajax content

Ñ óâàæåíèåì, Ñåðãåé Ïèìåíîâ Þðèñò-êîíñóëüòàíò Ðåãèñòðàòîð ua.alldomains

Îò: theburhan notifications@github.com Îáðàòíûé àäðåñ: olton/Metro-UI-CSS <reply+i-14539809-c360339d38e893e05c4911239a52c76dfce13011-365108@reply.gith ub.com> Äàòà: âòîðíèê, 21 ìàÿ 2013 ã., 00:12 Êîìó: olton/Metro-UI-CSS Metro-UI-CSS@noreply.github.com Òåìà: [Metro-UI-CSS] input btn-clear reloads the page (#245)

Hi,

I am struggling to find why does my page reloads when i click btn-clear (small cross on the left of input box).

My page is partial view which is loaded on ajax call. Do i need to reinitiallize button.js?

regards, Burhan

— Reply to this email directly or view it on GitHub https://github.com/olton/Metro-UI-CSS/issues/245 .

codewode commented 11 years ago

could you please specify how I do that?

luizfernandoro commented 11 years ago

Hello,

I'm having the same problem. I'm using MVC4 and after the first POST done on the page when I click the button to display a password or clear a input the page is sent back.

How can I fix this problem?

tobiodeyemi commented 11 years ago

See this page for an ajax reinit.

<!-- Accordion -->
    $()["Accordion"]({initAll: true});

    <!-- Carousel -->
    $()["Carousel"]({initAll: true});

    <!-- Input controls -->
    $()["Input"]({initAll: true});

    <!-- Rating -->
    $()["Rating"]({initAll: true});

    <!-- Slider -->
    $()["Slider"]({initAll: true});

    <!-- Dropdown -->
    $('.pull-menu, .menu-pull').each(function () {
        $(this).PullDown();
    });

    <!-- Page control -->
    $('[data-role="page-control"]').each(function () {
        $(this).PageControl();
    });
samscudder commented 10 years ago

I think this is no longer valid with the current software version... I suggest checking the code in metro-initiator.js. I had a problem with btn-clear on an ajax-loaded form, which I solved by calling $.Metro.initInputs() after loading succeeded.