This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stackLabels: { | |
enabled: true, | |
style: { | |
fontWeight: 'bold', | |
color:'black' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*The tab component doesnt work too well when u try to render it. | |
https://github.com/reactjs/react-tabs | |
Thanks to : deepaksisodiya | |
"Removing the selectedIndex={0} is not a solution, | |
You need to set it by state, like | |
selectedIndex={this.state.selectedTab} | |
also initialise selectedTab state to your preferred tab. | |
then on onSelect={this._handleSelect} event of Tabs, set the selectedTab again. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Para exportar a excel: | |
//Esta es la funcion para el boton exportar. | |
onClickExport(){ | |
//console.log("asd export"); | |
var data = this.state.interruptions; | |
var exportResults = []; | |
for (var i = 0; i < data.length; i++) { | |
exportResults.push(translator(data[i])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Algunas funciones que se utilizan en Jquery para la modificacion, agregación o eliminación de selectores. | |
//Cambia las propiedades de un selector. | |
$(".searchNotification").css("visibility","initial"); | |
//Elimina los hijos pertenecientes al padre del selector. (incluídos textos) | |
$( "#myNotification" ).empty(); | |
//Agrega un selector nuevo al padre. | |
$("#myNotification").append("<div><strong>NIS: " + this.refs.NIS.value +" presente en falla aislada</strong></div>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Para exportar componentes, se deben seguir los siguientes pasos: | |
• En un archivo js indicar los import correspondientes a las librerias react y react-dom, como otras(con rutas relativas). | |
Ejemplo: statistics-toolbar.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import token from '../services/token-service'; | |
import layers from '../services/layers-service'; | |
import mymap from '../services/map-service'; | |
• Construir el componente. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cada que se utilice un nuevo módulo se debe escribir la ruta relativa a la ubicación del archivo javascript en el apartado "entry". | |
Ejemplo: | |
... | |
module.exports = { | |
entry: { | |
login: './static/js/bundles/main.js', | |
dashboard: './static/js/bundles/dashboard.js', | |
interruptions: './static/js/bundles/interruptions.js' | |
}, | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Para comentar en la parte de renderizado del componente se utiliza {/* */} | |
Ejemplo: | |
return ( | |
<div className="mytable-Wrapper"> | |
{/*aaa */} | |
</div> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Es una "stateful function" que mantiene un estado interno pese a que ya se haya terminado de ejecutar la función. | |
*En js todas las funciones en javascript son closures implicitamente, lo unico que se hizo ahí fue hacerla explicita | |
*al retornar un objeto que usaba una var interna de la función, en este caso map. Así que mientras el objeto externo | |
*que tiene los metodos createMap y getMap viva, la variable map seguirá viva independiente de si se terminó de ejecutar la función mymap | |
*/ | |
Ejemplos: | |
function mymap(){ | |
var map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Funciones de un componente: | |
Cada componente posee funciones o métodos que pertenecen a su ciclo de vida que se pueden implementar: | |
• componentWillMount(): se ejecuta antes que se renderice el componente. | |
• componentDidMount(): se ejecuta despues que se renderiza el componente. | |
• shouldComponentUpdate(): devuelve un valor si el componente debiera actualizarse. | |
• componentWillUnMount(): se ejecuta antes que el componente se elimine. |
NewerOlder