根据某些条件隐藏单元格值 - jqGrid

时间:2013-08-27 20:31:59

标签: jquery jqgrid

我想根据某些条件隐藏单元格值,比如单元格值是< 20

2 个答案:

答案 0 :(得分:1)

您只需要一个格式化程序

jQuery("#grid_id").jqGrid({
...
   colModel: [ 
      ... 
      {name:'price', index:'price', width:60, align:"center", editable: true, formatter:currencyFmatter},
      ...
   ]
...
});

function currencyFmatter (cellvalue, options, rowObject)
{
   if (cellvalue < 20)
    return "";
   else
    return new_format_value
}

参考:http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter

答案 1 :(得分:0)

怎么样..

$('table td').each(function(){
  $this = $(this);
  if(parseFloat($this.text()) < 20) {
    $this.css('visibility', 'hidden');
  }
});
相关问题