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. |
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
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
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
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
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
Add the following files: | |
<script src="static/js/vendor/jspdf/jspdf.min.js"></script> | |
<script src="static/js/vendor/jspdf/jspdf.plugin.autotable.js"></script> | |
then make a fx with or w/o parameters, this one works like that just by example: | |
function exportToPDF(){ | |
var columns = ["ID", "Name", "Country"]; | |
var rows = [ | |
[1, "Shaw", "Tanzania"], |
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
git init: inicia el repositorio local en carpeta seleccionada. | |
git status: visualiza la lista de archivos que están disponibles y su estado (stage o no stage) | |
git add --all : coloca en stage todos los archivos | |
git commit -am "message" : una vez hecho un add a un archivo, hace commit con un mensaje para guardar los cambios. | |
git push <mygit> <master> : hace un push a un repositorio (remoto o local). | |
git pull <mygit> <master> : hace un pull (merge) a un repositorio (remoto o local) trayendo los cambios. | |
git stage: te devuelve al ultimo commit realizado. | |
git stage clear: borra todos los stages hechos. | |
Comandos para servidor remoto: |
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
Thanks to : JasonM23 | |
<h1>CSS Selector based on attribute</h1> | |
<p data-title="anything2">I'm suddenly something!</p> | |
[data-title='anything2'] { | |
//css here | |
} |
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
Source: http://stackoverflow.com/questions/39426819/selecting-a-row-in-react-griddle-and-changing-tr-background-color | |
First: | |
class ComponentWithGriddle extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
selectedRowId: 0, | |
}; |
OlderNewer