bsgrid 用法技巧

72 阅读1分钟

全局加title

  $.fn.bsgrid.defaults.additionalRenderPerColumn = function (record, rowIndex, colIndex, tdObj, trObj, options) {
            tdObj.attr("title", tdObj.text());
  };

统一设置列内容以及格式

 $.fn.bsgrid.defaults.additionalRenderPerColumn = function(record, rowIndex, colIndex, tdObj, trObj, options) {
            tdObj.attr("title", tdObj.text());
            if (options.columnsModel[colIndex].index == 'amount') {
                if (tdObj.text() != null) {
                    tdObj.text((tdObj.text() * 1).toFixed(2));
                } else {
                    tdObj.text("");
                }
            }
        };