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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRlcmZhY2VzLXRhYmxlLmpxdWVyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxrRUFBa0U7QUFDbEUsMENBQTBDO0FBRTFDLENBQUMsVUFBVSxDQUFNO0lBQ2IsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxjQUFjLEdBQUcsVUFBVSxJQUFTO1FBRXJDLE1BQU0sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDO1lBQ2IsSUFBSSxnQkFBZ0IsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUM7WUFFL0IsT0FBTyxDQUFDLEdBQUcsQ0FBQyxnQkFBZ0IsR0FBRyxJQUFJLENBQUMsUUFBUSxDQUFDLENBQUM7WUFDOUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsY0FBYyxHQUFHLElBQUksQ0FBQyxRQUFRLEdBQUcsR0FBRyxDQUFDLENBQUMsQ0FBQztZQUV6RSxnQkFBZ0IsQ0FBQ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