网址: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的更多相关文章

  1. jQuery.bsgrid

    http://thebestofyouth.com/bsgrid/ 支持json.xml数据格式,皮肤丰富并且容易定制,支持表格编辑.本地数据.导出参数构建等实用便捷的功能,容易扩展,更拥有丰富的示例 ...

  2. 12月14日 bs-grid , destroy_all()

    bootstrap Grid : The Bs grid system has four classes: xs (phones), sm (tablets), md (desktops), and ...

  3. ajax数据交互(arcgis server)

    通过ajax来调用服务器map数据,来实现搜索功能. 效果: 1.我要搜索下中国移动的地理信息: 2.会搜出17条消息,然后把他们分页显示,一页6条: 3.每一页的6天数据,会在map生成一个6条ma ...

  4. jsp界面的继承与否剖析

    引入页面时候 ${pageContext.request.contextPath}为页面上下文路径:也可以用js来实现: <script type="text/javascript&q ...

  5. Ajax 常用资源

    regular online:http://regex.larsolavtorvik.com/ json online:http://json.cn/ Prototype:http://prototy ...

随机推荐

  1. Program D--贪心-区间覆盖

    Given several segments of line (int the X axis) with coordinates [Li,Ri]. You are to choose the mini ...

  2. MapReduce数据流(一)

    在上一篇文章中我们讲解了一个基本的MapReduce作业由那些基本组件组成,从高层来看,所有的组件在一起工作时如下图所示: 图4.4高层MapReduce工作流水线 MapReduce的输入一般来自H ...

  3. SharePoint安全 - 攻破SharePoint(黑客工具介绍)

    博客地址 http://blog.csdn.net/foxdave SharePoint的安全性很高,这是我们潜意识里的第一印象,所以具体的安全性体现在哪并没仔细研究过.但是事实上确实没有绝对安全的东 ...

  4. Windows Server 2012 R2 设置

    一.任务栏左下角启动服务器管理器,然后进行设置.1.登录不显示服务器管理器 2.本地服务器,看到右边的IE增强的安全配置,如图所示,关闭两项内容.这样就关闭了IE增强安全提示框. 3.“工具”菜单,启 ...

  5. Centos6升级内核2.6到3.x过程

    最近公司有一个应用,安装需要内核版本3.1以后,不得已,需要升级下内核版本: 1. 安装必要依赖 # yum groupinstall "Development Tools" #y ...

  6. jQuery 自定义扩展,与$冲突处理

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  7. linux学习笔记3:linux的网络配置,rpm包,shell以及samba服务器的使用和安装

    1.linux下的shell<linux命令.编辑器和shell编程> (1)shell种类有很多,常用的有三种,在linux可以通过ls -l /bin/*sh 来显示所有已安装的she ...

  8. Titanium vs PhoneGap

    http://mobile.51cto.com/Titanium-318049.htm http://www.ibm.com/developerworks/cn/opensource/os-titan ...

  9. GSM Sniffing入门之硬件篇

    3个月前,听朋友介绍得知OsmocomBB项目.此前一直以为GSM Sniffing需要价格昂贵的专用设备,但osmocomBB的上手成本:一个25元左右的手机,外加一根USB转TTL的串口线,着实让 ...

  10. 黑马程序员——【Java基础】——String、StringBuffer和基本数据包装类

    ---------- android培训.java培训.期待与您交流! ---------- 类String---------------------------------------------- ...