首页 新闻 会员 周边

js 局部刷新

0
悬赏园豆:10 [已解决问题] 解决于 2015-03-06 15:17

如图 我想点击下拉列表的时候刷新下面这个表格的数据 

js代码如下 请问怎么当获取数据后不为空怎么刷新 table 
function selectfund() {
var selectfund = $("#selectfund_id").val();
$.post("?", { type: "selecfund", selectfund: selectfund },
function (data) {
if (data != null) {

}
})
}

要刷新的表 

<table class="data" width="100%" cellpadding="0" cellspacing="0">
<thead>
<tr>
<%-- <th style='width:5%;text-align:center'>
全选<input type="checkbox" id="select" />
</th>--%>
<th style='width:5%;text-align:center'>
序号
</th>
<th style='width:7%;text-align:center'>
自编号
</th>
<th style='width:7%;text-align:center'>
缴费时间
</th>
<th style='width:7%;text-align:center'>
交款单位
</th>
<th style='width:7%;text-align:center'>
缴费项目
</th>
<th style='width:8%;text-align:center'>
款项类别
</th>
<th style='width:8%;text-align:center'>
实收金额
</th>
<th style='width:9%;text-align:center'>
缴费单号
</th>
<th style='width:7%;text-align:center'>
经办人
</th>
<th style='width:10%;text-align:center'>
操作
</th>

</tr>
</thead>
<tbody>
<%=content%>
</tbody>
</table>

沐雨清风的主页 沐雨清风 | 初学一级 | 园豆:143
提问于:2015-02-25 10:45
< >
分享
最佳答案
0

异步刷新实现过程方案:

1、清空table中的数据

2、用模版引擎如mustache等,或者直接用拼html语句方式,然后渲染到table里面即可

收获园豆:10
fxrCross | 菜鸟二级 |园豆:220 | 2015-02-26 15:51

js用的不多 很多不会能给段代码吗?

沐雨清风 | 园豆:143 (初学一级) | 2015-03-03 14:07
其他回答(4)
0

看你用的好像是控件吧,直接后台刷新好了,不然麻烦

刘宏玺 | 园豆:14020 (专家六级) | 2015-02-25 11:25

是HTML 没控件在里面  

支持(0) 反对(0) 沐雨清风 | 园豆:143 (初学一级) | 2015-02-25 11:47
0

可以使用jquery的模板来实现,jquery-tmpl.js之类的都行

webaspx | 园豆:1973 (小虾三级) | 2015-02-25 14:00
0

一列列拼字符串绑定,要不就做替换

羽商宫 | 园豆:2490 (老鸟四级) | 2015-02-26 09:24
0

异步Jquery,查询后触发table的重新加载即可。

JAVA_Viter | 园豆:158 (初学一级) | 2015-02-26 13:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册