
jQuery(function ($) {
    initRupI18nPromise.then(function () {
		initFilter();
		initTable();
		
		
	});
	
	const initFilter = () => {}
	
	const initTable = () => {
		
		const getColumnsModelPago = function(){
			const getColumnModelPago = function (name, index, editable, hidden, orderable) {
				return {
					name: name,
					index: index,
					editable: editable,
					hidden: hidden,
					orderable: orderable
				}
			};
			let columnsModelPago = [];
			columnsModelPago.push(getColumnModelPago("idUnidadBase92", "idUnidadBase92", false, true, false));
			columnsModelPago.push(getColumnModelPago("descEs92", "descEs92", true, false));
			columnsModelPago.push(getColumnModelPago("descEu92", "descEu92", true, false));
			columnsModelPago.push(getColumnModelPago("idProvincia92", "idProvincia92", false,true, false));
			columnsModelPago.push(getColumnModelPago("idMunicipio92", "idMunicipio92", false,true, false));
			columnsModelPago.push({ 
				name: "fecBaja92", 
				index: "fNacimiento82", 
				editable: true, 
				hidden: false, 
				orderable: false, 
				rupType: 'date',
				editoptions: {
					yearRange: 'c-120:c',
					mask: 'dd/mm/yyyy',
					showButtonPanel : true,
					showOtherMonths : true,
	            },
			});
			columnsModelPago.push(getColumnModelPago("baja92", "baja92", false,true, false));
			columnsModelPago.push(getColumnModelPago("fecAlta92", "fecAlta92", false,true, true));
			columnsModelPago.push(getColumnModelPago("usuAlta92", "usuAlta92", false,true, false));
			columnsModelPago.push(getColumnModelPago("fecModif92", "fecModif92", false,true, false));
			columnsModelPago.push(getColumnModelPago("usuModif92", "usuModif92", false,true, false));
			return columnsModelPago;
			
			let tableColModels = [                    
				{ name: "idConviviente82", index: "idConviviente82", editable: false, hidden: true },
				{ name: "idInfSocial82", index: "idInfSocial82", editable: false, hidden: true },
				{ name: "nombreApellidos82", index: "nombreApellidos82", editable: true, hidden: false, orderable: false, },
				{ name: "parentesco82",	index: "parentesco82", editable: true, hidden: false, orderable: false,	},
				{ 
					name: "fNacimiento82", 
					index: "fNacimiento82", 
					editable: true, 
					hidden: false, 
					orderable: false, 
					rupType: 'date',
					editoptions: {
						yearRange: 'c-120:c',
						mask: 'dd/mm/yyyy',
						showButtonPanel : true,
						showOtherMonths : true,
		            },
				}						
			];
		};
		
		
			
		
		const getColumnsDefsPago = function () {
			return [ 
				
				
				
				
			
			];
		};
		
		const getCustomButtonsPago = function () {
			let customButonsPago = [];	
			
			
			
			
						
			return customButonsPago;
		};

		$("#unidadesBase").rup_table({
			colReorder: {
				fixedColumnsLeft: 1
			},
			colModel: getColumnsModelPago(),
			columnDefs: getColumnsDefsPago(),
			primaryKey: "idUnidadBase92",
	     	filter:{
	  	  		id:"unidadesBase_filter_form",
	  	  		filterToolbar:"unidadesBase_filter_toolbar",
	  	  		collapsableLayerId:"unidadesBase_filter_fieldset",
	  	  		showHidden: true
	     	},
	     	createTooltipBody: false,// No muestra el tooltip automático de las columnas de la tabla
	     	noEdit: true,
	   		select: {
	       		activate: true,
	       		deleteDoubleClick:true
	   		},
			buttons: {
				activate: true,
				blackListButtons: ['addButton', 'editButton', 'cloneButton', 'deleteButton', 'copyButton', 'pdfButton', 'odsButton', 'csvButton'],
				myButtons: getCustomButtonsPago()
			},
			columnOrderArrows: {
			    showOnlyActive: false,
			    display: 'inline'
			},
			order: [[1, "desc"], [2, "desc"]]
		});
	
	
	
	
	};
	
	
	
	
	
	
	
	
});
