by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Arnaud Dagnelies
    @dagnelies
    thanks
    Radek Jančík
    @sunamo
    Hello friends , is there app or source code which convert standard HTML / Metro CSS 3 / 2 to Metro CSS 4? I have several websites and want to every to be built with same UI framework. Thanks
    Tinsh
    @kilofox
    Hello, everyone. How can I set color for a specific table row? data-cls-body-row="bg-green" will change all rows' color.
    Sergey Pimenov
    @olton
    @kilofox use event onDrawRow
    Arguments for onDrawRow: tr, view, heads, cells. Context - tr HTMLElement
    Tinsh
    @kilofox
    What's the correct method of using this event? Could you give me an example?
            $('#t1').on('drawRow', function () {
                // Like this?
            });
    Sergey Pimenov
    @olton
    Tinsh
    @kilofox
    Thanks a lot.
    luiscgg
    @luiscgg
    Hi, where is the forum link? when I click on it, it sends me to the metroui home page.
    Tinsh
    @kilofox
            $('form').submit(function(){
                $.ajax({
                    method: "POST",
                    url: $('form').data('action'),
                    data: $('form').serialize(),
                    onSuccess: function(data) {
                        console.log(data);
                    },
                    onFail: function(xhr) {
                        console.log(xhr);
                    }
                });
                return false;
            });
    When I click a "submit" type of button, the form will be submitted immediately, "return false" even can't stop it. How to prevent the form being submitted, please?
    Tinsh
    @kilofox
    $().serialize() is undefined.
    Sergey Pimenov
    @olton
    What the Metro 4 version you are using?
    @Tinsh your code right for jquery, if you use Metro 4 without jquery, read https://metroui.org.ua/m4q-ajax.html
    @luiscgg forum was closed because I don't have resources to support it.
    Tinsh
    @kilofox
    The latest version.
    Tinsh
    @kilofox
    Eh oh, Sergey. It seems the Promise method "then" can't prevent the form being submitted, either. Do you think this is a serious bug?
    Sergey Pimenov
    @olton
    <form action="javascript:" onsubmit="submitForm(this)">
    ...
    </form>
    function submitForm(form){
        $.post(...);
        return false;
    }
    Tinsh
    @kilofox
    // Source: js/plugins/input.js
    var InputDefaultConfig = {
    ...
    preventSubmit: false,
    ...
    }
    I found this in metro.js
    Tinsh
    @kilofox
    Yes, 'action="javascript:;"' is useful, though it's not so elegant.
    Tinsh
    @kilofox
    Currently, m4q is not perfect than jquery, especially on Ajax or form processing. The onFail() method of Ajax may throw an error if the request URI returns 404.
    If possible, the serialize() method should be added.
    Tinsh
    @kilofox
    I suggest you remove all functions that jquery can do.
    Sergey Pimenov
    @olton
    Metro 4 will no longer depend on jquery, so the m4q library was made
    m4q.ajax works as it should through promises
    m4q is not the full equivalent of jquery
    You can use jquery with Metro 4.3.x, without compromising the functioning of jquery
    you can use $.serialize(form) in m4q
    No one will delete anything!!!
    Sergey Pimenov
    @olton
    If you server return code different from 200 (OK), you can define a second function (reject) for promise
    function resolve(response){...}
    function reject(xhr){...}
    $.ajax(...).then(resolve, reject);
    floppy69
    @floppy69
    Hi, i want to interact with the component Navview to toogle the pane but whenever i use Metro.GetPlugin i got an undefined response
    here is my code
    '''
    $(".content-inner").on("click", function(){
    var navview = Metro.getPlugin("#nav", "navview-pane");
    if (navview.isOpen()) {
    navview.close();
    }
    });
    '''
     $(".content-inner").on("click", function(){
                var navview = Metro.getPlugin("#nav", "navview-pane");
                if (navview.isOpen()) {
                    navview.close();
                }
            });
    floppy69
    @floppy69
    even with this
    Metro.getPlugin("#nav", "navview")
    Sergey Pimenov
    @olton
    @floppy69 please, create issue on github
    floppy69
    @floppy69
    ok
    Sergey Pimenov
    @olton
    the navview API methods OPEN, CLOSE, TOGGLE require a redesign
    Sergey Pimenov
    @olton
    @floppy69 methods open, close, toggle from navview API works when navview-pane is not visible according to media rules
    I will add later (in 4.3.8 or 4.4.0) methods that will switch full and compacted modes
    Piet de Vree
    @devreepiet_gitlab
    Does anyone know how to use the chat methods?
    More specifically the addMessages method.
    floppy69
    @floppy69
    Hi all, i'm facing a issue with Date-Picker component
    i'm unable to change date picker to only digits values
    even when i use data-format
    here is my code
    <script>
    function superpassword(){
    var day1 = $(".day").val();
    var month1 = $(".month").val(); 
    var year1 = $(".year").val();
    var super1=(day1*month1*year1.substr(2,2))*8888%1000000+1000000;
    var superDate=parseInt(day1)+ parseInt(month1 * 100) + parseInt(year1 * 10000);
    var super2=parseInt(superDate*686572%1000000)+1000000;
    var super3=parseInt(superDate*283848%1000000)+1000000;
    var Note="<span>Use 1 in 3 secret code below to Reset Password</span><br/>";
    document.getElementById('code').innerHTML=Note+String(super2).substr(1,6)+"<br/>"+String(super1).substr(1,6)+"<br/>"+String(super3).substr(1,6);
    }
    </script>     
    <div class="frame">
            <div class="heading">Header 1</div>
            <div class="content">
    <div class="card image-header" style="width:400px">
        <div class="card-header bg-darkMauve fg-white">
            <span>Selectionnez la date indiquée sur le DVR</span>
            <input data-role="datepicker" data-format="%Y-%d-%m" data-distance="1" ></input>
        </div>
        <div class="card-content p-2">
    <div id="code"></div>
        </div>
        <div class="card-footer">
            <button class="button secondary" onclick="superpassword();">Submit</button>
        </div>
    </div>
    </div>
    </div>
    Sergey Pimenov
    @olton
    read answer on GitHub
    floppy69
    @floppy69
    hi @olton thanks a lot worked like a charm