All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.webjars.skeleton.js.generic-renderers.js Maven / Gradle / Ivy

There is a newer version: 2.3
Show newest version
var tooltipRenderer = function (data, cell, record, rowIndex, columnIndex, store) {
    if (!!data) {
        cell.tdAttr += ' data-qtip="' + Ext.String.htmlEncode(data) + '"';
    }
    return data;
}
var tooltipWrapperRenderer = function (rendererFunction) {
    return function () {
        var toDisplay = rendererFunction.apply(this, arguments);
        return tooltipRenderer.apply(this, [toDisplay].concat(Array.prototype.slice.call(arguments, 1)));
    }
}
var nullableRenderer = function (rendererFunction) {
    return function (data) {
        if (!data) {
            return "N/A";
        }
        return rendererFunction.apply(this, arguments);
    }
}
var twoDigitsNumberRenderer = function (data, cell, record, rowIndex, columnIndex, store) {
    return Ext.util.Format.number(data, "0.00");
};
var percentRenderer = function (data, cell, record, rowIndex, columnIndex, store) {
    return (data >= 0 ? "+" : "") + Ext.util.Format.number(data, "0.00%")
};
var renderListAsTable = function (list) {
    var header = ''
    var body = '';
    for (var i = 0; i != list.length; ++i) {
        body += '';
    }
    var footer = '
' + list[i] + '
'; return header + body + footer; } var renderObjectDetailsAsTable = function (obj) { var header = '' var body = ''; for (var propt in obj) { body += ''; } var footer = '
' + propt + '' + obj[propt] + '
'; return header + body + footer; } var errorsToText = function (errors) { return "
    " + (errors || []).map(function (e) { return Ext.String.format("
  • {0}{1}{2}
  • ", e.context && (Ext.htmlEncode(e.context) + ":"), Ext.htmlEncode(e.reason), e.details && (" - " + Ext.htmlEncode(e.details))); }).join("\n") + "
"; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy