| Server IP : 138.197.176.125 / Your IP : 216.73.216.41 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/crm_easylife/libraries/jquery/handsontable/extensions/ |
Upload File : |
(function ($) {
"use strict";
/**
* Handsontable RemoveRow extension. See `demo/buttons.html` for example usage
* @param {Object} instance
* @param {Array|Boolean} [labels]
*/
Handsontable.extension.RemoveRow = function (instance, labels) {
var that = this;
this.priority = 1;
this.className = 'htRemoveRow htNoFrame';
this.instance = instance;
this.labels = labels;
instance.blockedCols.main.on('mousedown', 'th.htRemoveRow .btn', function () {
instance.alter("remove_row", $(this).parents('tr').index());
});
instance.container.on('mouseover', 'tbody th, tbody td', function () {
that.getButton(this).show();
});
instance.container.on('mouseout', 'tbody th, tbody td', function () {
that.getButton(this).hide();
});
instance.blockedCols.addHeader(this);
instance.container.addClass('htRemoveRow');
};
/**
* Return custom row label or automatically generate one
* @param {Number} index Row index
* @return {String}
*/
Handsontable.extension.RemoveRow.prototype.columnLabel = function (index) {
return '<div class="btn">x</div>';
};
/**
* Return button object for a given TD or TH
* @param {Element} td
* @return {jQuery}
*/
Handsontable.extension.RemoveRow.prototype.getButton = function (td) {
return this.instance.blockedCols.main.find('th.htRemoveRow .btn').eq($(td.parentNode).index());
};
})(jQuery);