Posts by Maurivan • 449 points
19 posts
-
0
votes1
answer37
viewsA: ngx-filter-pipe is returning the wrong index of my *ngFor when element is filtered
Since you’re just trying to get the Arr index, you can use the pipe keyvalue! Try the following: <tr *ngFor="let anuncio of sortedData | keyvalue"> If you want to keep the index order, you can…
-
1
votes1
answer154
viewsA: Looping jquery grab button value and put on label
I see no need to use $.each in that case. Follow the example below and implement to your reality that will work. $(document).ready(function(){ $('body').on ('click', 'table > tbody > tr >…
-
1
votes4
answers11284
viewsA: How to create temporary mirror table in another
The action of creating a temporary table based on another table in SQL Server can be done during a select any. You can create by referencing the entire table or just a few fields. Example: SELECT *…
-
0
votes2
answers662
viewsA: Set Auto Increment position, always for the smallest ID
One simple way to achieve this is by using a gatilho || trigger in the table where you want to control the auto_increment. Try to adapt the example below to your reality. Let’s imagine a…
-
1
votes1
answer288
viewsA: table always active with Ajax and php
A simple way to do this is by using the resource setTimeout javascript to run a certain function from time to time, creating a loop. Assuming you have any function to create and display the data…
-
0
votes2
answers2773
viewsA: consult record between two dates in mysql
This query only checks in the interval until the day 05/03/2017 at 00:00hrs. Try to put in the last parameter the full date, example: SELECT * FROM tabela WHERE data >= '2017-03-01' AND data…
-
7
votes2
answers15714
viewsA: mysql error 1215 cannot add Foreign key Constraint
The problem is in the field membro_id that accepts and has by default a value nulo, beyond the field id on the table members is configured not to accept negative numbers, type int(11) unsigned. How…
-
-1
votes2
answers379
viewsA: Birthday listing in a date range
Try to filter year and month as example below! SET DATEFORMAT DMY; DECLARE --@ANO INT; @MES INT; --SET @ANO = 2017; SET @MES = 2; -- fevereiro SELECT U.NUMERO, U.DATA FROM UTILIZADORES U WHERE --…
sql-serveranswered Maurivan 449 -
1
votes4
answers1392
viewsA: Return True or False in jQuery’s Success
The way you’re trying to use Ajax’s comeback doesn’t work. The ideal is to externalize this result and work with it from the "outside". Below is a demonstration, "untested" how to dock the Ajax…
-
0
votes1
answer245
viewsA: Icon of misaligned input
As can be seen below, no inconsistencies in the html output can be observed! I suggest checking the html markup and the order of the style files and scripts. <link…
-
3
votes1
answer526
viewsA: Select case in two tables
A small modification, sir! Try this untested script and post the result. SELECT s.id, s.data, case when s.tipoDestino = 1 then p.nome else u.descricao end as Destino, pr.descricao, s.quant FROM…
-
1
votes3
answers638
viewsA: How to take the current time and decrease 24 hours of it?
Decrease the current date by the amount of milliseconds in 24h. var date = (new Date () - ((24*60*60)*1000)); console.log(new Date(date));…
javascriptanswered Maurivan 449 -
3
votes1
answer5641
viewsA: How to close a modal only by buttons?
Use the option backdrop with data-backdrop="static". As set out in official documentation, this option makes the window modal do not close with the click, only with the buttons. <!-- Button…
-
0
votes2
answers721
viewsA: Object loop with Jquery each
Accesses the object message directly into the object date with pure javascript. for (index in data.message) { table +='<tr><td>' + index.id + '</td>'; table +='<td>' +…
-
1
votes1
answer187
viewsA: Difference between normal avg and using case when in Mysql
Note that in the first section you put as a condition the entire date. Already in the second piece of code, in the case, you filtered only the day of the month. Try with the script below: SELECT id,…
-
2
votes2
answers1368
viewsA: How to pass the dynamic id of a Div to a javascript function?
Good night! I suggest creating an attribute for the table row. Example: <table> <tbody> <tr data-id="2"> </tr> </tbody> </table> In javascript try the following:…
-
1
votes2
answers1804
viewsA: Php connected with SQL Server
Good night. If you don’t have the sqlsrv and pdo_sqlsrv extensions, try odbc. See how it looks: $pdo = new \PDO ("odbc:Driver={SQL Server Native Client…
-
3
votes2
answers586
viewsA: Scope between variables - Javascript
I guess that explains it. Declare the variables outside of Return and the internal functions you want to hide, declare as code below: var Main = function () { var fn = function () { // private }…
-
0
votes1
answer77
viewsA: Single ajax with different outputs that doesn’t work without async
Good afternoon! Try as in the example below: var ajaxData = { categoria: 'produtos', consulta: 'exibirProduto', codProduto: $('#produtoFieldCodProduto') }; var meuAjax = function (fn) { $.ajax ({…