Appearance and Styling

28 Jun 20176 minutes to read

Custom Text

WaitingPopup control provides support for Custom Text to mention any message inside the pop-up panel. You can specify a custom text through the text property that displays when the WaitingPopup is loading.

The following steps explains you the configuration of the custom text for WaitingPopup control.

In the HTML page, add a <div> element to render WaitingPopup widget.

  • HTML
  • <div class="control">
     <div id="waitingPopUp" ej-waitingpopup e-showoninit="true" e-text="Loading... Please wait..."></div>
    </div>

    Add the following styles to render WaitingPopup widget.

  • CSS
  • <style type="text/css" class="cssStyles">
       #waitingPopUp {
           height: 320px;
           width: 600px;
       }
    </style>

    Execute the above code to render the following output.

    Template

    We can customize the appearance of WaitingPopup widget using template support which is used to include the HTML content instead of the default image.

    The following steps explains that how to display a text and image using template for WaitingPopup control.

    In the HTML page, add a <div> element to configure WaitingPopup widget.

  • HTML
  • <div class="control">
        <div id="waitingPopUp" ej-waitingpopup e-cssclass="customcss" e-showoninit="true" e-template="#template"></div>
    </div>

    Add customized template for WaitingPopup control using the following code example.

  • HTML
  • <div id="content">
       <div class="block">
          <div class="logo"></div>
          <div class="txt">
             <p>Create cutting edge </p>
             <p><b>HTML5</b> web application </p>
             <p>with ease </p>
          </div>
       </div>
       <div class="loader"></div>
    </div>

    Initialize the WaitingPopup with custom template using the following code example.

  • JS
  • angular.module('WaitingPopupApp', ['ejangular'])
    .controller('WaitingPopupCtrl', function ($scope) {
        $scope.template = "#content";
    });

    In CSS, you can configure the custom styles for WaitingPopup.

    NOTE

    Images for this sample are available ‘installed sample location /images/waitingPopup’ and we need to define images in mentioned CSS. Henceforth the images will display.

  • CSS
  • <style type="text/css" class="cssStyles">
       #waitingPopUp {
           height: 320px;
           width: 600px;
           margin: 0 auto;
       }
       .block {
        height: 76px;
       }
       .logo {
           background-image: url("../images/waitingPopup/js_logo.png");
           float: left;
           height: 100%;
           width: 77px;
           margin-right: 15px;
       }
       .txt {
           float: left;
           font-size: 17px;
           height: 100%;
           text-align: left;
       }
       .txt p {
           margin: 0;
       }
       .loader {
           background: url("../images/waitingPopup/load_light.gif") no-repeat scroll -5px 18px transparent;
           height: 40px;
           width: 100%;
       }
       #content {
           cursor: default;
           height: 112px;
           width: 275px;
           color:white;
       }
    </style>

    Execute the above code to render the following output.

    CSS Class

    You can use the CSS class to customize the WaitingPopup control appearance. Define a CSS class as per requirement and assign the class name to cssClass property.

    The following steps allows you to configure CSS class for an auto-complete textbox.

    In the HTML page, add a <div> element to configure WaitingPopup widget.

  • HTML
  • <div class="control">
       <div id="waitingPopUp" ej-waitingpopup e-cssclass="customcss" e-showoninit="true" e-text="Loading.. Please wait..."></div>
    </div>

    Define CSS class for customizing the WaitingPopup widget.

  • CSS
  • <style type="text/css" class="cssStyles">
       /*Customize the panel property*/
       #waitingPopUp {
           height: 320px;
           width: 600px;
           margin: 0 auto;
       }
       /* Customize the WaitingPopup */
      .customcss{
        background-color: darkred;
        font-style: italic;
        font-weight: bolder;
        opacity: 0.5;		
        color: white;
      }
    </style>

    The following screenshot displays the output for the above code.