Si tenemos un array de objetos con multiples propiedades, podemos ordenarlo en base a una de sus propiedades de tipo texto, como puede ser, en muchos casos, el título. Utilizaremos la funcion "sort" comparando los títulos con "localeCompare", de la siguiente manera: let orderedArray = myOriginalArray.sort((a, b) => a.Title.localeCompare(b.Title));
Etiqueta: text
Añadir Tipos de Fuente en la Ribbon de SharePoint
Se pueden añadir estilos personalizados en el editor de texto de la ribbon de sharepoint mediante el uso exclusivo de CSS: Crear un nuevo elemento p.ms-rteElement-MyElement1 { -ms-name: 'My Custom Element'; /* CSS Styles Here */ } El primer selector de css es el elemento que vamos a usar (en este caso, un párrafo "p", …
Sigue leyendo Añadir Tipos de Fuente en la Ribbon de SharePoint
Export SQL query to CSV
1. Execute your Query with "Results to Grid" option selected (You can select this option with its icon or by menu "Query - Results To - Results to grid"). 2. Once your Query has finished, right-click on the results grid and select the option "Save results As...". 3. Save as Type: CSV.
Change IP from Host File
This script works doing a PING request and obtaining its resultant IP. Feel free to change it and modify it as you need. First part does the PING request, second part changes the Host File and the third part opens the hosts file. Explanation of the secon part: 1. Save the Hosts File text in …
Disable input ENTER key in Chrome, FireFox, IE (including IE8), etc. by Javascript & JQuery
In order to disable the ENTER key in your textbox type input, you have to add the 'onkeydown' attribute and call a javascript function that checks the key and avoid to submit the form when you press ENTER key. Input example <input name="myName" type="text" value="Search" onclick="eraseInitialText(this);" onkeydown="disableEnter();"> Javascript function function disableEnter() { var key = …
Remove HREF attribute from any link with JQuery
You can remove any href that contains specific text inside the link. If you want to remove the link to any page that contains "DispForm" you can do it like this: $('a[href*="DispForm"]').removeAttr("href"); '*=' means 'Contains', but you can use anything you need: *= Contains = Equal != Not equal ^= Starts With $= Ends With