欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Bootstrap 填充Json數(shù)據(jù)的實(shí)例代碼

 更新時間:2017年01月11日 16:29:15   作者:CharlinGod  
本篇文章主要介紹了Bootstrap 填充Json數(shù)據(jù)的實(shí)例代碼,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

本文介紹Bootstrap 填充Json數(shù)據(jù),具體如下:

一、如圖:

二、html代碼:

<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<div class="content">
  <div class="table-responsive"> 
  <div class="container-fluid" > 
    <div class="row-fluid"> 
       <form class="form-inline well well-sm" id="monitor_form" role="form">
        <div class="form-group pdate">
          <label for="date">起日期:</label><input type="text" id="startDate" name="startDate" class="form-control layer-date" data-options="editable:false,required:true"/>
          <i class="iconfont">&#xe613;</i>
        </div>
        <div class="form-group pdate">
          <label for="date">止日期:</label><input type="text" id="endDate" name="endDate" class="form-control layer-date" data-options="editable:false,required:true"/>
          <i class="iconfont">&#xe613;</i>
        </div> 
        <div class="form-group">
          <a href="javascript:void(0);" class="button bPrimary" id="iconsearch" ><i class="iconfont"></i>查詢</a>
        </div>
      </form>
      <div class="col-xs-6 nospace" >
      <div class="panel panel-default">
         <div class="panel-heading">統(tǒng)計(jì)圖表</div>
         <div class="panel-body" style="border:0px;">
          <img id="JPGE_pdId" src="" title='統(tǒng)計(jì)圖表' alt='統(tǒng)計(jì)圖表'/> 
         </div>
      </div>
      </div>
      <div class="col-xs-6 nospace"> 
      <div class="panel panel-default">
         <div class="panel-heading">統(tǒng)計(jì)數(shù)據(jù)</div>
         <div class="panel-body noborder" style="border:0px;">
          <!-- <table id="monitor-table" class="table-striped table-hover" data-mobile-responsive="true"></table> -->
          <table id="monitor-table" class="table table-striped table-hover ">
            <thead>
              <tr>
                <th data-field="item0">數(shù)據(jù)類型</th>
                <th data-field="item1">流程名稱</th>
                <th data-field="item2">數(shù)值</th>           
              </tr>
            </thead>
          </table> 
         </div>
      </div>
      </div>
    </div> 
  </div>
  </div>
</div>

三、js代碼:

<script>
var $table = $("#monitor-table");
$(function(){
  refFlushChart();
  $("#iconsearch").click(function(){
    refFlushChart();
  });
});

function refFlushChart(){
  var params = $("monitor_form").serialize();
  var url = "${ctx}/workflow/central!monitorJPEG.action";
  submitForm(params,url, function(data){
    if( data.mess!=null&&data.mess.length > 0 ){
      Comfirm.show("提示", data.mess);
    }
    $("#JPGE_pdId").attr("src",data.imgUrl);
    //var dataObj = eval("(" + JSON.stringify(data.dataGrid) + ")");
    var dataObj = data.dataGrid;
    alert(dataObj.length);
    //$table.bootstrapTable('load', jQuery.parseJSON(data.dataGrid));
    $.each(dataObj,function(index,item){
      var $tr = $('<tr>');
      $.each(item,function(name,val){
        var $td = $('<td>').html(val);
        $tr.append($td);
      });
      $table.append($tr);
    });
  });
}

四、json數(shù)據(jù)格式:

{
  "state": 200,
  "mess": "",
  "startDate": "2016-10-04",
  "endDate": "2016-11-03",
  "imgUrl": "/workflow/reportChart/201611/03/5e39452448594fe8a8579d1993029759.jpg",
  "dataGrid": [
    {
      "item0": "開單數(shù)",
      "item1": "申請1",
      "item2": "1"
    },
    {
      "item0": "開單數(shù)",
      "item1": "申請2",
      "item2": "15"
    }
  ]
}

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • 改進(jìn):論壇UBB代碼自動插入方式

    改進(jìn):論壇UBB代碼自動插入方式

    改進(jìn):論壇UBB代碼自動插入方式...
    2006-12-12
  • 一篇文章詳解JS的四種異步解決方案

    一篇文章詳解JS的四種異步解決方案

    異步在JS中是常用的,下面這篇文章主要給大家介紹了關(guān)于JS四種異步解決方案的相關(guān)資料,文中通過代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用js具有一定的參考借鑒價值,需要的朋友可以參考下
    2024-06-06
  • JavaScript中重名的函數(shù)與對象示例詳析

    JavaScript中重名的函數(shù)與對象示例詳析

    最近同事問了一個問題,說在js中如果函數(shù)與對象重名了會怎么樣?仔細(xì)詳細(xì)這個問題值得討論一下,所以便有了這篇文章,這篇文章主要給大家介紹了關(guān)于JavaScript中重名的函數(shù)與對象的相關(guān)資料,需要的朋友可以參考借鑒,下面來一起看看吧啊。
    2017-09-09
  • 用JS實(shí)現(xiàn)選項(xiàng)卡

    用JS實(shí)現(xiàn)選項(xiàng)卡

    這篇文章主要為大家詳細(xì)介紹了用JS實(shí)現(xiàn)選項(xiàng)卡效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-03-03
  • Javascript BOM學(xué)習(xí)小結(jié)(六)

    Javascript BOM學(xué)習(xí)小結(jié)(六)

    BOM:BrowserObjectModel,瀏覽器對象模型,提供JS中對瀏覽器的各種操作的對象,是JS應(yīng)用中唯一沒有相關(guān)標(biāo)準(zhǔn)的部分,這事BOM經(jīng)常出現(xiàn)問題的所在,主要用于處理瀏覽器窗口與框架,瀏覽器特有的JS擴(kuò)展也被默認(rèn)為BOM的一部分,而各瀏覽器之間的公有對象就成了默認(rèn)的標(biāo)準(zhǔn)
    2015-11-11
  • 微信小程序開發(fā)之組件設(shè)計(jì)規(guī)范

    微信小程序開發(fā)之組件設(shè)計(jì)規(guī)范

    這篇文章主要給大家介紹了關(guān)于微信小程序開發(fā)之組件設(shè)計(jì)規(guī)范的相關(guān)資料,對剛?cè)腴T學(xué)習(xí)微信小程序的同學(xué)們還是挺有幫助的,需要的朋友可以參考下
    2021-05-05
  • JavaScript?編寫枚舉的最有效方法分享

    JavaScript?編寫枚舉的最有效方法分享

    這篇文章主要介紹了JavaScript?編寫枚舉的最有效方法分享,JavaScript語言本身不支持枚舉。如果我們想模擬枚舉,我們可以使用一個對象。更多相關(guān)內(nèi)容感興趣的小伙伴可以參考一下
    2022-06-06
  • JS實(shí)現(xiàn)下拉菜單列表與登錄注冊彈窗效果

    JS實(shí)現(xiàn)下拉菜單列表與登錄注冊彈窗效果

    下面小編就為大家?guī)硪黄狫S實(shí)現(xiàn)下拉菜單列表與登錄注冊彈窗效果。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-08-08
  • Javascript Echarts空氣質(zhì)量地圖效果詳解

    Javascript Echarts空氣質(zhì)量地圖效果詳解

    這篇文章主要介紹了詳解Javascript利用echarts畫空氣質(zhì)量地圖,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-10-10
  • JavaScript中this關(guān)鍵字用法實(shí)例分析

    JavaScript中this關(guān)鍵字用法實(shí)例分析

    這篇文章主要介紹了JavaScript中this關(guān)鍵字用法,結(jié)合實(shí)例形式總結(jié)分析了javascript中this關(guān)鍵字在不同條件下的指向問題與相關(guān)操作技巧,需要的朋友可以參考下
    2018-08-08

最新評論