首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

jquery grid 扩充formatter

2012-10-08 
jquery grid 扩展formatter先将代码给出,以后整理。{name:isopen, index:isopen, width:55, edittype:

jquery grid 扩展formatter
先将代码给出,以后整理。
{name:'isopen', index:'isopen', width:55, edittype:"checkbox",editoptions: {value:"1:0"}, editable:true, formatter:"customIsOpen"},
jQuery.extend($.fn.fmatter , {
    customIsOpen : function(cellvalue, options, rowobject) {
        if(cellvalue == 1)
return "开放";
else
return "没有开放";
    }
});
jQuery.extend($.fn.fmatter.customIsOpen , {
unformat : function(cellvalue, options, cellobject) {
var value = $(cellobject).html() == "开放" ? "1" : "0";
return value;
}
});

热点排行
Bad Request.