bsgrid
网址:http://bsgrid.oschina.mopaasapp.com/
var total = gridObj.options.totalRows;
jquery必须放在bsgrid的前面
根据条件生成不同的操作
function render_operate0(record, rowIndex, colIndex, options) {
var str=' ';
if(record.Status ==1){
str+= '<a title="退款" onclick="return(\'编辑\',\'${ctx}/count/callbank?id='+record.id+'\')" val='+record.id+' href="#"><span>退款</span></a>';
}
}
格式化金额:
<th w_index="amt" w_render="render_amt">金额(元)</th>
function render_amt(record, rowIndex, colIndex, options){
return fmoney(record.amt,2);
}
function fmoney(s, n) {
if(null==s){
return "0.00";
}
n = n > 0 && n <= 20 ? n : 2;
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
var one = "";
if(s.startWith("-")){
s = s.replace("-","");
one = "-"
}
var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
t = "";
for (i = 0; i < l.length; i++) {
t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
}
return one+t.split("").reverse().join("") + "." + r;
}
序号:<th w_num="total_line" width="3%;">序号</th>
function render_operator(record, rowIndex, colIndex, options){
var astr = [];
if(record.status==0){
astr.push('<a class="ml-5" href="javascript:onclick=update(\''+record.loginId+'\',\''+record.msgId+'\')">');
astr.push('推送</a>');
}else {
astr.push('<a class="ml-5" href="javascript:onclick=deleteMsg(\''+record.loginId+'\',\''+record.msgId+'\')">');
astr.push('删除</a>');
}
return astr.join("");
}
\' :表示单引号(')
bsgrid的更多相关文章
- jQuery.bsgrid
http://thebestofyouth.com/bsgrid/ 支持json.xml数据格式,皮肤丰富并且容易定制,支持表格编辑.本地数据.导出参数构建等实用便捷的功能,容易扩展,更拥有丰富的示例 ...
- 12月14日 bs-grid , destroy_all()
bootstrap Grid : The Bs grid system has four classes: xs (phones), sm (tablets), md (desktops), and ...
- ajax数据交互(arcgis server)
通过ajax来调用服务器map数据,来实现搜索功能. 效果: 1.我要搜索下中国移动的地理信息: 2.会搜出17条消息,然后把他们分页显示,一页6条: 3.每一页的6天数据,会在map生成一个6条ma ...
- jsp界面的继承与否剖析
引入页面时候 ${pageContext.request.contextPath}为页面上下文路径:也可以用js来实现: <script type="text/javascript&q ...
- Ajax 常用资源
regular online:http://regex.larsolavtorvik.com/ json online:http://json.cn/ Prototype:http://prototy ...
随机推荐
- 一模 (2) day1
第一题: 题目大意: 设 2n 张牌分别标记为 1, 2, ..., n, n+1, ..., 2n,初始时这 2n 张牌按其标号从小到大排列.经一次洗牌后,原来的排列顺序变成 n+1, 1, n+2 ...
- mysql中Access denied for user 'root'@'localhost' (using password:YES)(zhuan)
错误代码 1045Access denied for user 'root'@'localhost' (using password:YES) 如果你的mysql也出现以上这种提示, 建议你逐个字看完 ...
- 【转发】RedHat Enterprise Linux 6.4 使用 Centos 6 的yum源问题
作为一名新手,学习Linux已经一个月了,其间遇到了不少问题,而今天笔者遇到的问题是 #yum install pam-devel #This system is not registered to ...
- android 定时器的使用
1.android中通常是使用AlarmManager来定时启动一个单次或重复多次操作的.具体的说就是我们通过AlarmManager设定一个时间和注册一个intent到系统中,然后在该时间到来时,系 ...
- 10 件在 PHP 7 中不要做的事情
1. 不要使用mysql_函数 这一天终于来了,从此你不仅仅"不应该"使用mysql_函数.PHP 7 已经把它们从核心中全部移除了,也就是说你需要迁移到好得多的mysqli_函数 ...
- SharePoint 2013 Nintex Workflow 工作流帮助(八)
博客地址 http://blog.csdn.net/foxdave 工作流动作 15. Complete Workflow Task(User interaction分组) 此工作流动作将完成任何进行 ...
- yum源的更新问题
我们知道在linux下安装软件的方法有多种多样,其中利用yum的方式来安装较为简单,但需要等待的时间比较长.下面介绍一下如何更新yum的源的问题. 首先需要保证的是linux的机器能上网.然后按照下面 ...
- (转)Document对象内容集合
原文:http://webcenter.hit.edu.cn/articles/2009/06-10/06144703.htm document 文挡对象 - JavaScript脚本语言描述 ——— ...
- 12-27cell 的可重用性(英雄列表应用性能的优化)
在英雄列表中动态生成cell的代码在中, - (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N ...
- BZOJ 4562 食物链
我们需要拓扑一下. #include<iostream> #include<cstring> #include<cstdio> #include<algori ...