GithubHelp home page GithubHelp logo

loadingpanel's Introduction

This sample code demonstrates how to show a simple loading panel until a long running action completes. This code sample is implememnted using ASP.NET Core and Jquery on Visual Studio 2017 with .NET Core 2.0

It has used a div tag as a loading panel and showed it when the action method starts, after data loads succesfully it hides the loading panel

Read this article to find how to add a Jquery loading panel, ASP.NET Core : How to show a loading panel in a page

This code snippet shows how to show a loading panel in middle of a long running action, If you want to style this loading panel you can use bootstrap styling or any other technique

<script>
        $(function () { 

            $('#loaddata').click(function () { 

                $('#loading-div-background').show(); 

                Promise.resolve($.ajax({ 
                    type: "GET", 
                    url: '/Home/GetData', 
                    contentType: false, 
                    processData: false 
                })).then(function (result) { 
                    if (result) { 
                        $('#loading-div-background').hide(); 
                        $("#tableheader").show() 
                        var row = ""; 
                        $.each(result, function (index, item) { 
                            row += "<tr><td><input type='checkbox'id='chk_" 
                                + item + "'/></td><td>" + item + "</td><td>" 
                                + item + "</td><td>" + item + "</td><td>" + item 
                                + "</td><td>" + item + "</td></tr> "; 
                        }); 
                        $("#tablebody").html(row); 
                    } 
                }).catch(function (e) { 
                    console.log(e); 
                }); 
            }); 

        }); 
    </script>

loadingpanel's People

Contributors

hansamaligamage avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.