admin-lte
Version:
Responsive open source admin dashboard and control panel.
571 lines (419 loc) • 18.7 kB
HTML
<html lang="en"> <head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Card Refresh Plugin | AdminLTE 3 Documentation</title>
<!-- Begin Jekyll SEO tag v2.5.0 -->
<title>Card Refresh Plugin | AdminLTE v3 Documentaion</title>
<meta name="generator" content="Jekyll v3.8.5" />
<meta property="og:title" content="Card Refresh Plugin" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="AdminLTE v3 Documentaion" />
<meta property="og:description" content="AdminLTE v3 Documentaion" />
<meta property="og:site_name" content="AdminLTE v3 Documentaion" />
<script type="application/ld+json">
{"description":"AdminLTE v3 Documentaion","@type":"WebPage","url":"/javascript/card-refresh.html","headline":"Card Refresh Plugin","@context":"http://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700">
<link rel="stylesheet" href="/assets/plugins/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="/assets/plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
<link rel="stylesheet" href="/assets/css/docs.css">
<link rel="stylesheet" href="/assets/css/highlighter.css">
<link rel="stylesheet" href="/assets/css/adminlte.min.css">
</head>
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed">
<div class="wrapper"> <nav class="main-header navbar navbar-expand navbar-white navbar-light">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fa fa-bars"></i></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link bg-info rounded dropdown-toggle" href="#" id="navbarVersionDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
v3.0
</a>
<div class="dropdown-menu py-0" aria-labelledby="navbarVersionDropdown">
<a class="dropdown-item bg-info disabled" href="#">v3.0</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="https://adminlte.io/docs/2.4/installation">v2.4</a>
<a class="dropdown-item" href="https://adminlte.io/themes/AdminLTE/documentation/index.html"><= v2.3</a>
</div>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<!-- <li class="nav-item d-none d-sm-inline-block">
<a href="index3.html" class="nav-link">Home</a>
</li> -->
</ul>
<!-- SEARCH FORM -->
<!-- <form class="form-check-inline ml-3">
<div class="input-group input-group-sm">
<input class="form-control form-control-navbar" type="search" placeholder="Search" aria-label="Search">
<div class="input-group-append">
<button class="btn btn-navbar" type="submit">
<i class="fa fa-search"></i>
</button>
</div>
</div>
</form> -->
</nav>
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<a href="/index.html" class="brand-link logo-switch">
<img src="/assets/img/logo-xs.png" alt="AdminLTE Docs Logo Small" class="brand-image-xl logo-xs">
<img src="/assets/img/logo-xl.png" alt="AdminLTE Docs Logo Large" class="brand-image-xs logo-xl" style="left: 12px">
</a>
<div class="sidebar">
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar nav-child-indent flex-column" data-widget="treeview" role="menu">
<li class="nav-item ">
<a href="/index.html" class="nav-link ">
<i class="nav-icon fas fa-microchip"></i>
<p>
Installation
</p>
</a>
</li>
<li class="nav-item ">
<a href="/dependencies.html" class="nav-link ">
<i class="nav-icon fas fa-handshake"></i>
<p>
Dependencies & Plugins
</p>
</a>
</li>
<li class="nav-item ">
<a href="/layout.html" class="nav-link ">
<i class="nav-icon fas fa-copy"></i>
<p>
Layout
</p>
</a>
</li>
<li class="nav-item has-treeview ">
<a href="/components" class="nav-link ">
<i class="nav-icon fas fa-th"></i>
<p>
Components
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="/components/main-header.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Main Header</p>
</a>
</li>
<li class="nav-item">
<a href="/components/main-sidebar.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Main Sidebar</p>
</a>
</li>
<li class="nav-item">
<a href="/components/control-sidebar.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Control Sidebar</p>
</a>
</li>
<li class="nav-item">
<a href="/components/cards.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Card</p>
</a>
</li>
<li class="nav-item">
<a href="/components/boxes.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Small-/ Info-Box</p>
</a>
</li>
<li class="nav-item">
<a href="/components/direct-chat.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Direct Chat</p>
</a>
</li>
<li class="nav-item">
<a href="/components/timeline.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Timeline</p>
</a>
</li>
<li class="nav-item">
<a href="/components/ribbons.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Ribbons</p>
</a>
</li>
<li class="nav-item">
<a href="/components/miscellaneous.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Miscellaneous</p>
</a>
</li>
<li class="nav-item">
<a href="/components/plugins.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Plugins</p>
</a>
</li>
</ul>
</li>
<li class="nav-item has-treeview menu-open">
<a href="/javascript" class="nav-link active">
<i class="nav-icon fas fa-code"></i>
<p>
JavaScript
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="/javascript/layout.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Layout</p>
</a>
</li>
<li class="nav-item">
<a href="/javascript/push-menu.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Push Menu</p>
</a>
</li>
<li class="nav-item">
<a href="/javascript/treeview.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Treeview</p>
</a>
</li>
<li class="nav-item">
<a href="/javascript/card-widget.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Card Widget</p>
</a>
</li>
<li class="nav-item">
<a href="/javascript/card-refresh.html" class="nav-link active">
<i class="far fa-circle nav-icon"></i>
<p>CardRefresh</p>
</a>
</li>
<li class="nav-item">
<a href="/javascript/control-sidebar.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Control Sidebar</p>
</a>
</li>
<li class="nav-item">
<a href="/javascript/direct-chat.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Direct Chat</p>
</a>
</li>
<li class="nav-item">
<a href="/javascript/todo-list.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Todo List</p>
</a>
</li>
<li class="nav-item">
<a href="/javascript/toasts.html" class="nav-link ">
<i class="far fa-circle nav-icon"></i>
<p>Toasts</p>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="/browser-support.html" class="nav-link ">
<i class="nav-icon fab fa-chrome"></i>
<p>
Browser Support
</p>
</a>
</li>
<li class="nav-item ">
<a href="/upgrade-guide.html" class="nav-link ">
<i class="nav-icon fas fa-hand-point-up"></i>
<p>
Upgrade Guide
</p>
</a>
</li>
<li class="nav-item ">
<a href="/implementations.html" class="nav-link ">
<i class="nav-icon fas fa-bookmark"></i>
<p>
Implementations
</p>
</a>
</li>
<li class="nav-item ">
<a href="/faq.html" class="nav-link ">
<i class="nav-icon fas fa-question-circle"></i>
<p>
FAQ
</p>
</a>
</li>
<li class="nav-item ">
<a href="/license.html" class="nav-link ">
<i class="nav-icon fas fa-file-alt"></i>
<p>
License
</p>
</a>
</li>
</ul>
</nav>
</div>
</aside>
<div class="content-wrapper px-4 py-2">
<div class="content-header">
<h1 class="text-dark">Card Refresh Plugin</h1>
</div>
<div class="content px-2">
<p>The card refresh plugin provides the functionality for loading ajax content into the card.</p>
<h5>Usage</h5>
<p>This plugin can be activated as a jQuery plugin or using the data api.</p>
<h6 class="text-bold">Data API</h6>
<p>Activate the plugin by adding a button with <code class="highlighter-rouge">data-card-widget="card-refresh"</code> to the card and provide the required <code class="highlighter-rouge">data-source="/URL-TO-CONTENT"</code> option. By doing that, the plugin will automatically create a GET request to the provided URL and render the returned response the <code class="highlighter-rouge">.card-body</code> section of the card. If you need to process the returned response before rendering, you should use the jQuery API, which provides hooks to deal with the response.</p>
<h6 class="text-bold">jQuery</h6>
<p>The jQuery API provides more customizable options that allows the developer to pre-process the request before rendering and post-process it after rendering.</p>
<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">(</span><span class="s2">"#my-card"</span><span class="p">).</span><span class="nx">refreshBox</span><span class="p">(</span><span class="nx">options</span><span class="p">)</span>
</code></pre></div></div>
<h5 class="mt-4">Options</h5>
<table class="table table-bordered bg-light">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>source</td>
<td>String </td>
<td> ’’</td>
<td>The URL to the source.</td>
</tr>
<tr>
<td>sourceSelector</td>
<td>String </td>
<td> ’’</td>
<td>A selector to get return only the content of the selector.</td>
</tr>
<tr>
<td>params</td>
<td>Object </td>
<td> {}</td>
<td>GET query paramaters (example: {search_term: ‘layout’}, which renders to URL/?search_term=layout)</td>
</tr>
<tr>
<td>trigger</td>
<td>String </td>
<td> <code class="highlighter-rouge">[data-card-widget="card-refresh"]</code></td>
<td>The CSS selector to the refresh button</td>
</tr>
<tr>
<td>content</td>
<td>String </td>
<td> <code class="highlighter-rouge">.card-body</code></td>
<td>The CSS selector to the target where the content should be rendered. This selector should exist within the card.</td>
</tr>
<tr>
<td>loadInContent</td>
<td>Boolean </td>
<td> TRUE</td>
<td>Whether to automatically render the content.</td>
</tr>
<tr>
<td>loadOnInit</td>
<td>Boolean </td>
<td> TRUE</td>
<td>Init plugin on page load.</td>
</tr>
<tr>
<td>responseType</td>
<td>String </td>
<td> ’’</td>
<td>Response type (example: ‘json’ or ‘html’)</td>
</tr>
<tr>
<td>overlayTemplate</td>
<td>String </td>
<td> TRUE</td>
<td>The HTML template for the ajax spinner</td>
</tr>
<tr>
<td>onLoadStart</td>
<td>Function </td>
<td> Anonymous Function</td>
<td>Called before the ajax request is made</td>
</tr>
<tr>
<td>onLoadDone</td>
<td>Function </td>
<td> Anonymous Function</td>
<td>Called after the ajax request is made. A <code class="highlighter-rouge">response</code> parameter is passed to the function that hold the server response.</td>
</tr>
</tbody>
</table>
<h5 class="mt-4">Events</h5>
<table class="table table-bordered bg-light">
<thead>
<tr>
<th>Event Type </th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>loaded.lte.cardrefresh</td>
<td> Triggered after a card is refreshed.</td>
</tr>
<tr>
<td>overlay.added.lte.cardrefresh</td>
<td> Triggered after the overlay added to the card.</td>
</tr>
<tr>
<td>overlay.removed.lte.cardrefresh</td>
<td> Triggered after the overlay removed from the card.</td>
</tr>
</tbody>
</table>
<p>Example: <code class="highlighter-rouge">$('#my-card [data-card-widget="card-refresh"]').on('loaded.lte.cardrefresh', handleLoadedEvent)</code></p>
<h5 class="mt-4">Methods</h5>
<table class="table table-bordered bg-light">
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>load</td>
<td>Reloads the content and runs the <code class="highlighter-rouge">onLoadStart</code> and <code class="highlighter-rouge">onLoadDone</code> hooks</td>
</tr>
</tbody>
</table>
<p>Example: <code class="highlighter-rouge">$('#my-card-widget').Widget('toggle')</code></p>
</div>
</div>
<footer class="main-footer">
<div class="float-right d-none d-sm-inline">
v3.0.1
</div>
<strong>Copyright © 2014-2019 <a href="https://adminlte.io">AdminLTE.io</a>.</strong> All rights reserved.
</footer>
</div>
<script src="/assets/plugins/jquery/jquery.min.js"></script>
<script src="/assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="/assets/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<script src="/assets/js/adminlte.min.js"></script>
</body>
</html>