META-INF.resources.butterfaces-dist-js.butterfaces-table.jquery.js Maven / Gradle / Ivy
///
///
(function ($) {
$.fn.selectTableRow = function (data) {
return this.each(function () {
var $originalElement = $(this);
console.log("Selected row: " + data.rowIndex);
console.log($originalElement.find("tr[rowindex=" + data.rowIndex + "]"));
$originalElement.find("tr").removeClass("butter-table-row-selected");
var listItems = $originalElement.find("tr[rowindex=" + data.rowIndex + "]");
$(listItems[listItems.length - 1]).addClass("butter-table-row-selected");
});
};
}(jQuery));
(function ($) {
$.fn.sortTableRow = function (renderIds, disableRenderIds, columnNumber) {
return this.each(function () {
var $table = $(this);
// let rows = $table.find("tbody > tr").length;
// let columns = $table.find("thead th").length;
ButterFaces.Ajax.sendRequest($table.attr("id"), "sort_" + columnNumber, renderIds, columnNumber, disableRenderIds);
});
};
}(jQuery));
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRlcmZhY2VzLXRhYmxlLmpxdWVyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxrRUFBa0U7QUFDbEUsMENBQTBDO0FBRTFDLENBQUMsVUFBVSxDQUFNO0lBQ2IsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxjQUFjLEdBQUcsVUFBVSxJQUFTO1FBRXJDLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQztZQUNiLElBQUksZ0JBQWdCLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDO1lBRS9CLE9BQU8sQ0FBQyxHQUFHLENBQUMsZ0JBQWdCLEdBQUcsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFDO1lBQzlDLE9BQU8sQ0FBQyxHQUFHLENBQUMsZ0JBQWdCLENBQUMsSUFBSSxDQUFDLGNBQWMsR0FBRyxJQUFJLENBQUMsUUFBUSxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7WUFFekUsZ0JBQWdCLENBQUMsSUFBSSxDQU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