1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| (function ($) {
$(".menu_tabs li:second").click();
//var handsone_marques;
var myRenderer = function (instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments);
if (cellProperties.check_error) {
$(td).addClass('check_error');
} else {
$(td).removeClass('check_error');
}
};
var defaultOptions = {
manualColumnMove: false,
manualColumnResize: false,
manualRowResize: false,
stretchH: 'all',
outsideClickDeselects: false,
rowHeaders: true,
colHeaders: true,
fixedColumnsLeft: 5,
columnSorting: false,
//contextMenu: true,
contextMenu: ['row_above', 'row_below', 'remove_row', '-----------', 'undo', 'redo'],
minRows: 5,
autoColumnSize: true,
//debug: true,
};
defaultOptions.afterChange = function (changes, source) {
console.log(arguments);
};
defaultOptions.beforeChange = function (changes, source) {
console.log(arguments);
};
defaultOptions.beforeValidate = function (value, row, prop, source) {
console.log(arguments);
};
defaultOptions.cells = function (row, col, prop) {
var cellProperty = {};
cellProperty.language = "fr";
return cellProperty;
};
$.ajax({
url: "categorie_marques_tab.php",
type: "get"
}).done(function (data) {
var errors = data.errors || {};
var options = $.extend(defaultOptions, data);
$('.tableur_marques').handsontable(options);
//handsone_marques = $('.tableur_marques').handsontable("getInstance");
// handsone_marques.updateSettings(options_menu);
});
})(jQuery); |
Partager