Dynamic 动态可编辑:使用格式化程序:

Dynamic 动态可编辑:使用格式化程序:,dynamic,jqgrid,Dynamic,Jqgrid,我在我的模型中使用 一个 {name:'state',index:'state',width:30,align:center,formatter:currencyFmatter} 功能是这样的 function currencyFmatter (cellvalue, options, rowObject) { var new_format_value; if(cellvalue == 0){

我在我的模型中使用 一个

{name:'state',index:'state',width:30,align:center,formatter:currencyFmatter}

功能是这样的

function currencyFmatter (cellvalue, options, rowObject)
                {
                var new_format_value;
                   if(cellvalue == 0){
                       new_format_value = '<span class="label label-info arrowed-in-right arrowed">Free</span>';
                   }else if(cellvalue == 1){
                       new_format_value = '<span class="label label-success arrowed">Used</span>';
                   }else if(cellvalue == 2){
                       new_format_value = '<span class="label label-warning"><i class="ace-icon fa fa-exclamation-triangle bigger-120"></i> &nbsp;WARNING</span>';

                   }
                   return new_format_value
                }
但是,如果我同时使用OnSetrow::和formatter:这两个工具,那么它们就不能一起使用了

如果网格创建,我想在我的哥伦比亚州显示一些标签css sytle标签 但是如果我想编辑行,那么我想在这个ColumState中使用一个带有

请问我要做什么? 非常感谢你的帮助

致意
Achim

我现在添加了unformate和formatter,这很有效。但编辑行后,格式化程序选项不会重新加载。这意味着,我看不到我的标签,只有我的复选框。这是我的colModel:{name:'state',index:'state',width:30,align:center,edittype:checkbox,editoptions:{value:Yes:No},formatter:currencyFmatter,unformat:aceswitchables},在我提交编辑行之后,我想展示一下我从formatter:best-him那里得到了什么
onSelectRow: function(id){ 
                    var ret = jQuery(grid_selector).jqGrid('getRowData',id);
                    alert(id);
                    if (ret.state=='1')
                     {
                        jQuery(grid_selector).setColProp('state',{editable:true, edittype:"checkbox", editoptions: {value:"Yes:No"}, unformat: aceSwitch });}
                    else {  jQuery(grid_selector).setColProp('state',{editable:false});}
                },