WebDataRocks实现table电子表格透视网格筛选器代码

代码语言:html

所属分类:表格

代码描述:WebDataRocks实现table电子表格透视网格筛选器代码

代码标签: WebDataRocks table 电子 表格 透视 网格 筛选器 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
 
<meta charset="UTF-8">
 
 
 
 
<style>
@import url("https://fonts.googleapis.com/css?family=Poppins");

body
{
       
font-family: "Poppins", Roboto;
       
font-size: 18px;
       
background: #ededed;
}
main
{
       
width: 1000px;
       
margin: 10px auto;
       
padding: 30px;
       
background: #fff;
       
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
}

h1
{
       
text-align: center;
       
margin-top: 0px;
       
color: #009688;
}

span
{
       
color: #009688;
}

h4
{
       
font-size: 17px;
       
margin-bottom: 10px;
}

p
{
       
font-size: 15px;
       
margin-bottom: 10px;
}

p
.details {
       
color: #888888;
}

.content {
       
position: relative;
       
display: flex;
       
align-items: center;
       
gap: 40px;
}

ul
{
       
list-style: none;
       
margin-left: 0;
       
padding-left: 0;
}

li
h4:before {
       
font-family: webdatarocks-icons;
       
content: "\e90e";
       
color: #009688;
       
padding-right: 5px;
}
</style>


 
 
</head>

<body translate="no">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/webdatarocks.1.4.15.css">
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/webdatarocks.toolbar.1.4.15.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/webdatarocks.1.4.15.js"></script>

<main>
       
<h1>WebDataRocks Pivot Grid Filters</h1>
               
<div id="wdr-component"></div>
       
<div class="content">
       
               
<div class="note">
                       
<h3> WebDataRocks supports <span>three</span> types of filters: </h3>
                       
<ul>
                               
<li>
                                       
<h4>Filtering by member names.</h4>
                                       
<p>Use it to show the values of the specific members.</p>
                                       
<p class="details"><span>Date.Month</span> field is filtered by Spring months.</p>
                               
</li>

                               
<li>
                                       
<h4>Filtering by values.</h4>
                                       
<p>Also known as the Top/Bottom X filter.
                                                Use it to keep records within a specified range (with values higher or lower than a specified number).
</p>
                                       
<p class="details"><span>Date.Year</span> field shows Top 5 sum of Sales.</p>
                               
</li>

                               
<li>
                                       
<h4>A report filter.</h4>
                                       
<p>Use it to apply filtering to the entire report.</p>
                                       
<p class="details">Aircraft and Bikes are excluded from <span>Category</span> field.</p>
                               
</li>
                       
</ul>
               
</div>

       
</div>
</main>
 
     
<script >
var pivot = new WebDataRocks({
  container: "#wdr-component",
  //toolbar: true,
  width: 980,
  height: 480,
  report: {
    dataSource: {
      dataSourceType: "json",
      data: getSalesData() },

    slice: {
      reportFilters: [
      {
        uniqueName: "Category",
        filter: {
          members: ["Category.Aircraft", "Category.Bikes"],
          negation: true } }],



      rows: [
      {
        uniqueName: "Date.Year",
        filter: {
          type: "top",
          quantity: 5,
          measure: "Sales" },

        sort: "unsorted" },

      {
        uniqueName: "Date.Month",
        filter: {
          members: ["Date.Month.February", "Date.Month.January"],
          negation: true } }],



      columns: [
      {
        uniqueName: "Country" }.........完整代码请登录后点击上方下载按钮下载查看

网友评论0