Posts by Tobias Mesquita • 22,900 points
750 posts
-
0
votes1
answer87
viewsA: How to download a table of the quasar in excel format (xlsx)?
Unfortunately, an XLSX file is not as simple as a CSV, so you will need to help and another lib, such as Sheetjs js-xlsx Here an example of use. var ws = XLSX.utils.json_to_sheet([ { A:"S", B:"h",…
-
1
votes2
answers153
viewsA: What to do when looping repeats in 2 different areas
You need to organize your inputs, follow an example var titulos = [] var divTitulos = document.getElementById("titulos") var tmplTitulo = document.getElementById("tmplTitulo").content var…
javascriptanswered Tobias Mesquita 22,900 -
0
votes1
answer94
viewsA: Internet data consumption using Vue.Js or similar
in general, a SPA page after it is loaded will consume less bandwidth than a traditional application (Multi Page), however depending on how the implementation is, you will have to download a large…
-
4
votes2
answers631
viewsA: how to transform an array of arrays into a single javascript array?
you can do it this way.: var matriz = [ ['A', 'B', 'C'], ['D'], ['E', 'F'], ['G', 'H', 'I', 'J'] ] var array = matriz.reduce((list, sub) => list.concat(sub), []) console.log(array)…
-
4
votes2
answers534
viewsA: Fill List with sql return
Why reinvent the wheel? use the Dapper.: string connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; SqlConnection con = new…
-
2
votes1
answer1113
viewsA: DOM manipulation with Vuejs and Jquery
For cases where you need to run an external Javascript, especially those that manipulate the DOM, it is recommended to encapsulate it in a component. Another important point is that the properties…
-
2
votes1
answer59
viewsA: How do I detect whether the $http request is a cache response or not?
I don’t believe it’s possible, at least not with the $cacheFactory standard. You may use this lib angular-cache, basically it replaces the $cacheFactory with a lot of extras. Another option is not…
-
0
votes2
answers247
viewsA: Send Dropdown Value to Iframe
me general way, the ideal that the communication between different documents is made using message exchange. Let’s take the following use case, the page should send a text (value of textarea) to the…
-
1
votes1
answer1194
viewsA: How to adjust picture in container
let’s take for example this image.: It’s 512 x 512, so let’s put it inside a 256 x 128 container .box { float: left; width: 256px; height: 128px; margin: 10px 5px; border-radius: 5px; box-shadow:…
-
3
votes1
answer129
viewsA: Name of a Role with accent in the Identity database
There is no problem técnico in using accents, or even spaces. Until why what is compared is not the Name and yes the NormalizedName, this by definition must allow comparison with special…
-
4
votes2
answers1741
viewsA: How is the 'Two way data Binding' process with pure JS?
Understand, make a Two-Way Data Binding from nothing is much more complicated than it seems, after all you will have to predict all scenarios, so I strongly advise you not to try it, and use a tool…
javascriptanswered Tobias Mesquita 22,900 -
2
votes3
answers459
viewsA: Is there a specific event in Javascript to detect when a <option> of a <datalist> is selected?
There is no event that does what you ask, but nothing prevents the creation of one. Follows a proposal. (function () { var event = new Event("selected") var inputs =…
-
0
votes3
answers127
viewsA: (Pure js) function that Filtre array so that it returns single arrays with distinct elements
var lista = [ [3,4,7,9,4],[3,4,7,9,5],[3,4,7,9,6],[3,4,7,9,7], [3,4,7,9,8],[3,4,7,9,9],[3,4,8,3,3],[3,4,8,3,4], [3,4,8,3,5],[3,4,8,3,6],[3,4,8,3,7],[3,4,8,3,8],…
-
1
votes2
answers1043
viewsA: Onclick does not call the function
I believe the function apostar is defined in a file *.js separate, just as the good practices. but the same should be minified by webpack, and during this process variables (including functions) are…
javascriptanswered Tobias Mesquita 22,900 -
1
votes1
answer24
viewsA: How to page the Iamazons3.Listobjects method?
Following the documentation of SDK for JavaScript, you have to know the NextMarker for the query to return the data after a given result. Thus, it is not possible to consult by a specific page…
-
1
votes2
answers124
viewsA: li’s up and down one after one
follows a possibility, basically a combination of setTimeout, setInterval and transition: top var lis = document.querySelectorAll("ul li"); var trans = 750; // mesmo tempo aplicado no CSS. var dur =…
-
1
votes1
answer38
viewsA: Add Class to elements other than this Hover
you can use the method mouseOver and mouseLeave to set the item in focus var app = new Vue({ el: "#app", data: { itens: [ { id: 1, value: 'text 01' }, { id: 2, value: 'text 02' }, { id: 3, value:…
vue.jsanswered Tobias Mesquita 22,900 -
0
votes1
answer36
viewsA: Access one-page classes, id’s, div’s with my extension
let’s look at the signature of create and of executeScript create − chrome.tabs.create(object createProperties, function callback) the second argument from create, is a function of callback who…
-
1
votes1
answer535
viewsA: Relational Order Tables in C#
The first thing to do, is create the tables, in case you would have the tables Produto, Pedido and the relationship table PedidoProduto. CREATE TABLE dbo.Produtos ( ProdutoId uniqueidentifier NOT…
-
1
votes2
answers184
viewsA: Is it possible to set a timer before running a post/Reload on the page?
You can use the setTimeout // a pagina será atualizada em 5 segundos. window.setTimeout(window.location.reload, 5000); on the other hand, this SweetAlert returns a Promise, then you can expect the…
-
5
votes3
answers96
viewsA: Compare inputs with the same class and no id
the advice I give you, is to enter each row of the table, and use the same as scopo. var validar = document.getElementById("validar") validar.addEventListener("click", function (evt) { // obtendo…
-
1
votes1
answer126
viewsA: Clear history of`-router`when loading main menu
Unfortunately (or fortunately) it is not possible to change the browsing history, for safety reasons, browsers do not allow it. If you want to seek an outline solution, you can try something during…
-
0
votes3
answers657
viewsA: Click and dblclick in javascript
My suggestion is that you use only the event click, and make the change between cruz and circulo. var game = [ [null, null, null], [null, null, null], [null, null, null], ] var squares =…
-
3
votes2
answers104
viewsA: Is there a performance benefit in replacing the operator "==" with the operator "=="?
I believe you’re referring to the rule eqeq. The reason for this rule is not because it wants to gain performance, but to improve cohesion, after all the Algorithm of Abstract Equality is quite…
-
1
votes1
answer51
viewsA: Failed Pouchdb Replication for Couchdb
Source of the Answer.: Webpack: Promise is not a constructor The problem was a misunderstanding between the pouchdb-promise and the webpack. Like the PouchDb is using a polyfill to the Promise, even…
-
0
votes1
answer51
viewsQ: Failed Pouchdb Replication for Couchdb
Caenarius I have the following code.: ['tableA', 'tableB', 'tableC'].forEach(name => { let local = new PouchDB(name, { auto_compaction: true }) let server = new PouchDB(serverUrl + name) var…
-
0
votes1
answer383
viewsA: Row with Details in Datatable
Unfortunately, by doing the command below, you are recreating the table.: $('#tabela').dataTable().api() an elegant solution would pass again the options.: Object.defineProperty(window, 'dtOpcoes',…
answered Tobias Mesquita 22,900 -
1
votes2
answers139
viewsA: Ajax with clean url how to use browser back
you will have to add some state at the history, you will retrieve it in the event popstate the example below will add the value of input as a state in the history. if you navigate, the value of…
-
0
votes2
answers44
viewsA: Object is coming null
I tried to simulate your problem here, but the same did not occur.: function pisca(item) { var ob = document.getElementById(item); if (ob.style.color == "red") { ob.style.color = "black"; } else {…
javascriptanswered Tobias Mesquita 22,900 -
2
votes2
answers107
viewsA: Bring another field in group by
try the following.: var quantidades = ( from item in objectProd group item.CFOP_ID by item.CFOP_ID ).ToDictionary(grp => grp.Key, grp => grp.Count()) foreach(var produto in objectProd) { var…
c#answered Tobias Mesquita 22,900 -
1
votes1
answer61
viewsA: Linq to Objects - Performance
The two queries are not equivalent, but the difference between them is unfaithful, the second is just bringing an extra column (resulting in a bigger traffic). However both queries must have the…
-
0
votes3
answers992
viewsA: Bring the latest record with conditional - Postgresql
you can combine the window function ROW_NUMBER with a subquery (in the example below, I am using a CTE) WITH CTE_Compras AS ( SELECT ROW_NUMBER() OVER (PARITION BY cod_cliente ORDER BY data_compra…
-
1
votes3
answers73
viewsA: How do I select the latest records for specific entries?
You can partition to query using the window function ROW_NUMBER. WITH CTE_Compras AS ( SELECT ROW_NUMBER() OVER (PARTITION BY ClienteId ORDER BY CompraId DESC) AS Ordem ClienteId, CompraId FROM…
sql-serveranswered Tobias Mesquita 22,900 -
1
votes1
answer111
viewsA: Vuejs2 Update of Directives
try setting the value to be formatted as the directive value. var intl = new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }) Vue.directive('money', { bind: function (el, binding)…
-
1
votes1
answer30
viewsA: Edit group and real-time file
You did not mention the technology you are using. however MeteorJS falls like a glove to solve your problem. But regardless of the set of technologies adopted by you, the solution with the best…
-
0
votes1
answer96
viewsA: Is Dataannotation compatible with Json?
To Controller will validate the input independent of Content-Type used, but it is important that the input is with the ratings. Another point, the API by default will serialize the return to JSON,…
-
0
votes1
answer75
viewsA: Object Reference not set to an instance of an Object in return from Procedure
I see you’re using EF6, so you can simplify this call to.: db.Database.SqlQuery<string>("Sp_InsertContratoGestores");
c#answered Tobias Mesquita 22,900 -
2
votes1
answer321
viewsA: Default value for property according to type Ef core
the EF Core has no such method, but you can extend the ModelBuilder for it to gain this functionality. A while ago, I needed to configure the properties of a certain interface. But as you might…
-
3
votes1
answer89
viewsA: Error doing counter via c#
Your repository returns a async Task<IEnumerable<object>>, then you need a await to access the collection (which has the method Count) `(await new…
-
2
votes1
answer329
viewsA: Ajax in MVC - Select
I’m assuming that the Controller is being called and the data is being received in the correct way. If there is any question as to this, open the Developer Tools -> Network and see if the request…
-
2
votes1
answer911
viewsA: Remove object from the current array in foreach?
To remove an item from the Array during the interaction, the interesting thing is to perform the interaction starting at the end.: var lista = [ { id: 1, text: 'texto 01' }, { id: 2, text: 'texto…
javascriptanswered Tobias Mesquita 22,900 -
2
votes2
answers348
viewsA: CSS tab system with 2 lines of tabs - code using "float"
The bottom list is not being displayed, because the contents of the upper tabs are superimposing them. Then it will be necessary to the contents out of the ul, but in doing so, it will not be…
-
0
votes2
answers56
viewsA: SQL sub-consultations with counter
can hold a pivot.: SELECT Estado, [Estagiário], [Analista], [Gerente] FROM ( SELECT Estado, Cargo FROM @tabela ) AS t PIVOT( COUNT(Cargo) FOR Cargo IN ([Estagiário], [Analista], [Gerente]) ) AS p…
-
2
votes1
answer42
viewsA: Problem passing information from AJAX to Controller
To send a primitive type per post, you must perform a small gambiarra (which is even documented). 1st Option - send a JSON with the empty property.: curl -X POST…
-
5
votes2
answers679
viewsA: Maintain item order in JSON
Unlike Arrays, an Object has no obligation to maintain the order of the keys. If you want to keep the order of the items, you must send an array. var json = [ { key: "6", value: "Abadia" }, { key:…
-
2
votes1
answer834
viewsA: API Web Post Returns Invalid Content Type
just a hint, keep in memory the instance of your HttpClient, in his PostAsync you should inform only the relative path. Understand the reason by reading the following article: YOU'RE USING…
-
0
votes4
answers487
viewsA: Fill a datatable from a txt
What is your version of SQL Server? Depending we can use ROWNUMBER or OFFSET FETCH. And as for Pivotgrid, you can use Virtual Scroll…
-
1
votes4
answers487
viewsA: Fill a datatable from a txt
if you want to popular a DataTable, should not be using a DataReader, but rather a DataAdapter.: var adapter = new SqlDataAdapter(minhaConsulta, customerConnection); var dataSet = new DataSet();…
-
2
votes1
answer328
viewsA: Web API does not accept parameters in the constructor with Autofac
When analyzing the documentação, saw that you skipped an important step, register the Controllers. protected void Application_Start() { var builder = new ContainerBuilder(); // Get your…
-
1
votes2
answers110
viewsA: Given a select, how to store in an array (using pure Javascript) the value of all selected options?
you can use selectedOptions. var mySelect = document.getElementById("mySelect"); mySelect.addEventListener("change", function (event) { var options = [].map.call(mySelect.selectedOptions, function…