第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

在這里問下有沒有研究過easy ui的大神,數(shù)據(jù)為什么刷新不出來呢?

在這里問下有沒有研究過easy ui的大神,數(shù)據(jù)為什么刷新不出來呢?

bestDove 2016-09-13 18:23:25
使用easy UI是為了將數(shù)據(jù)圖表化,簡(jiǎn)潔美觀,但是里面的數(shù)據(jù)一直無法刷新出來,我的代碼里面寫了兩條數(shù)據(jù),但是顯示出來的一條數(shù)據(jù)都沒有,網(wǎng)上找了好多解決方法,逐個(gè)試了一遍都沒變化,所以只好來這里求助了0.0,代碼如下<!DOCTYPE?html> <html> <head> ????<meta?charset="UTF-8"> ????<title>easy?ui?數(shù)據(jù)如何顯示??</title> ????<link?rel="stylesheet"?type="text/css"?> ????<link?rel="stylesheet"?type="text/css"?> ????<script?type="text/javascript"?src="http://code.jquery.com/jquery-1.4.4.min.js"></script> ????<script?type="text/javascript"?src="http://www.w3cschool.cc/try/jeasyui/jquery.easyui.min.js"></script> ????<script?type="text/javascript"> ????????function?formatPrice(val,row){ ????????????if?(val?<?20){ ????????????????return?'<span?style="color:red;">('+val+')</span>'; ????????????}?else?{ ????????????????return?val; ????????????} ????????} ????????</script> </head> <body> <script?type="text/javascript"> ????var?dataBest?=?eval("("?+?'{?"total":2,?"rows":[{"id":1,"channel":"channel","pushfee":101,"ctime":"ctime","close":"close"},{"id":2,"channel":"channel","pushfee":102,"ctime":"ctime","close":"close"}]}'?+")"); ????$(function()?{ ????????$('#test').datagrid({ ????????????onBeforeLoad:?function?(param)?{ ????????????????var?firstLoad?=?$(this).attr("firstLoad"); ????????????????if?(firstLoad?==?"false"?||?typeof?(firstLoad)?==?"undefined") ????????????????{ ????????????????????$(this).attr("firstLoad","true"); ????????????????????return?false; ????????????????} ????????????????return?true; ????????????}, ????????????title:?"列表標(biāo)題", ????????????iconCls:?'icon-save', ????????????width:?800, ????????????height:?600, ????????????method:'get', ????????????nowrap:?false, ????????????striped:?true, ????????????url:dataBest, ????????????sortName:?'id', ????????????sortOrder:?'desc', ????????????idField:?'id', ????????????frozenColumns:?[[ ????????????????{?field:?'ck',?checkbox:?true?}, ????????????????{?title:?'編號(hào)',?field:?'id',?width:80,sortable:true?} ????????????]], ????????????columns:?[[ ????????????????{?title:?'基本信息',?colspan:?4?}, ????????????????{ ????????????????????field:?'opt',?title:?'操作',?width:?100,?align:?'center',?rowspan:?4, ????????????????????formatter:?function(value,?rec)?{ ????????????????????????return?'<span?style="color:red">編輯?刪除</span>'; ????????????????????} ????????????????} ????????????],?[ ????????????????{?field:?'channel',?title:?'渠道',??width:?120?}, ????????????????{?field:?'pushfee',?title:?'推廣費(fèi)',?width:?120}, ????????????????{?field:?'ctime',?title:?'注冊(cè)時(shí)間',?width:?120?}, ????????????????{?field:?'close',?title:?'結(jié)算狀態(tài)',?width:?120?} ????????????]], ????????????pagination:?true, ????????????rownumbers:?true, ????????????singleSelect:?false, ????????????toolbar:?[{ ????????????????text:?'添加', ????????????????iconCls:?'icon-add', ????????????????handler:?function()?{ ????????????????????alert('添加數(shù)據(jù)') ????????????????} ????????????},?'-',?{ ????????????????text:?'保存', ????????????????iconCls:?'icon-save', ????????????????handler:?function()?{ ????????????????????alert('保存數(shù)據(jù)') ????????????????} ????????????}] ????????}); ????}); </script> <table?id="test"></table> </body> </html>看官網(wǎng)介紹的Url寫的是一個(gè).json文件名,這里我沒有這樣寫,而是使用了一個(gè)字符串創(chuàng)建了一個(gè)json數(shù)據(jù),直接賦值給了url,而最終的效果如下圖所示:但是無論怎樣寫,數(shù)據(jù)就是不顯示,本身對(duì)于web學(xué)習(xí)不算太系統(tǒng),現(xiàn)在做的內(nèi)容算是引用一個(gè)第三方的工具來實(shí)現(xiàn)表格數(shù)據(jù)展示,因此有點(diǎn)吃力,跪求大神指點(diǎn)0.0
查看完整描述

1 回答

已采納
?
小白師兄

TA貢獻(xiàn)55條經(jīng)驗(yàn) 獲得超37個(gè)贊

你好,你自己模擬的數(shù)據(jù)已經(jīng)是json格式的了,在加載數(shù)據(jù)的時(shí)候,你不應(yīng)該用url,而是應(yīng)該用data,像這樣:

data: dataBest,其他的不變!效果圖如下

http://img1.sycdn.imooc.com//57d7eaf00001c09408030275.jpg

祝你好運(yùn)!么么噠,

希望采納喔!

查看完整回答
2 反對(duì) 回復(fù) 2016-09-13
  • 1 回答
  • 1 關(guān)注
  • 2380 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)