Posts by Guto • 582 points
19 posts
-
0
votes1
answer27
viewsA: How to build: click on the current line and load the clicked line information
In vuetify there is an event called click:row that you use in the tag v-data-table where you can place your function which will fill the form model with the desired information. My answer was based…
-
0
votes1
answer85
viewsA: Problem with the calculator in Go [BEGINNER]
You’re performing the operations before you even get the entries, so go uses the initial values of the variables to get the result. Another error in your code is that you are reading the entries in…
-
2
votes1
answer227
viewsA: Reactivity of Objects in Vuejs (vuex)
I went through problems like that too, I don’t know exactly why this is happening but vuex has a problem with reactivity when it is done nested, in case you are updating the property of an object…
-
0
votes1
answer202
viewsA: Route does not work in Vue.js - Go to ' / ' instead of ' ' /login '
You need to create a router-view on its home page, in the case of the App, that will direct to Content when / and to Login when /login. Example: <script…
-
0
votes3
answers66
viewsA: Get Function value in javascript
Since you’re creating one Listener for the action scroll of the window you can store this information in some variable in data. let vue = new Vue({ el: "#app", data() { return { oldScroll: 0,…
-
2
votes1
answer271
viewsA: Similar Vuejs animation in Jquery
You can use the states of lifecycle of the Vue instance to keep a loading component visible as in the example below. When your page is loaded it will invoke the method mounted, in it you can define…
-
2
votes1
answer289
viewsA: Vue is not rendering table with v-for, how to solve?
EDIT: I changed the answer to be more in line with the Vue documentation. There are two ways: Involving in a tag <template> which is a valid tag inside a tbody and using the attribute is…
-
1
votes1
answer81
viewsA: Problems with Async/Await and Vuex!
When you use async/await you don’t need to use the function then() to wait for the Promise, she will be the return of await. An asynchronous function may contain an expression await, what pause the…
-
1
votes2
answers381
viewsA: Mongoose pre method, returns this as empty object
Change your Arrow Function for a normal function. An expression Arrow Function has a shorter syntax when compared to a function expression (Function Expression) and doesn’t have his own this,…
-
6
votes1
answer1596
viewsA: What is the maximum of decimal places allowed in the PHP float?
Floating point numbers have limited accuracy. Although it relies on the system, PHP generally uses the IEEE 754 double-precision format, which will bring maximum accuracy due to rounding of the…
-
12
votes7
answers10590
viewsA: How do I know if today’s date is Saturday or Sunday (weekend) in PHP?
If you have PHP >= 5.1: function isWeekend($date) { return (date('N', strtotime($date)) >= 6); } but: function isWeekend($date) { $weekDay = date('w', strtotime($date)); return ($weekDay == 0…
-
1
votes1
answer229
viewsA: How to simulate a "min-top" in css
CSS: #div1 { min-height:50px; background-color: #fee; margin-bottom:-50px; } #div2 { margin-top:50px; background-color: #efe } http://jsfiddle.net/vVsAn/5051/ Upshot: When the div1 is hidden, div2…
-
4
votes1
answer2275
viewsA: How to get current date with time in js?
vc can use the momentjs diff function. And when creating a new Moment() you are already creating it with the current date. [EDITED] If you want the text to appear in English just add the library…
javascriptanswered Guto 582 -
1
votes2
answers228
viewsA: Choose option through a choice previously made
You could use Knockoutjs to do this. var tipoProduto = [{ id: 1, descricao: "Frutas" }, { id: 2, descricao: "Produto de Limpeza" }, { id: 3, descricao: "Carnes" }]; var produtos = [{ nome: "Banana",…
javascriptanswered Guto 582 -
1
votes1
answer63
viewsQ: Create a treeview that accepts an observable array as input
Hello, I need to create a treeview that accepts an observable as input so that as I remove/add a node in the tree the same update. I have been researching and many people use the biding template to…
-
1
votes3
answers75
viewsA: In a String separates with data separated by ";" how to take the 2nd data?
Use the string class split function. String frase = "Alberto;jose;Felipe;Ana"; String[] array = frase.split(";");
-
1
votes1
answer401
viewsA: Dynamically add Checkbox
You could use an observable array of Knockout.js to do this. var ViewModel = function(){ self = this; //inicializa a lista de checkboxs vazia self.listaCheckBox = ko.observableArray([]);…
-
1
votes1
answer87
viewsA: How to send data to the database, compare and display on the website?
If you have no intention of using a framework to back-end (which I recommend using), you could make the connection as in this example. var connection = new ActiveXObject("ADODB.Connection") ; var…
-
1
votes1
answer819
viewsA: How to make a basic configuration in the persistence.xml file to access a database in SQL Server 2008?
You can try it: <?xml version="1.0" encoding="UTF-8"?> <persistence-unit name="tarefas"> <provider>org.hibernate.ejb.HibernatePersistence</provider>…