« first day (3507 days earlier)      last day (1444 days later) » 

12:11 AM
is there possible to update the echart from other component?
for example your echart is in the home then you have another component which is the reload-chart.
 
hi
 
@teacosts Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
12:23 AM
Hi there, I'm looking for someone to review a solution I wrote to a test prep problem, and maybe help me figure out the time complexity. Thank you
 
@EmilyS. Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
 
11 hours later…
11:13 AM
@EmilyS. don't ask to ask just ask :]?
 
11:33 AM
BENJI
 
12:20 PM
@JBis It looks a lot better @JBis , well done on auto-adjusting the image to fit different window sizes . It's amazing how something as small as fixing the crop issue when a browser window is not maximized can have a noticeable impact on the UI.
 
1:02 PM
Is there a way to use a CSS animation without adding a second class?
Oh yeah, keyframes duh
 
Hello all,

Has been using angular with bootstrap and ng-bootstrap.

Switching over to angular-material. CDK looks better.

Which is the css framework that goes with it? Couldn't find a doc like bootstrap has on layout
 
1:19 PM
I mean it's designed for the Material Design system?
For layout, logs of people use Angular Flex Layout
 
1:38 PM
already using angular-material. do you know whether angular-material have layout classes
 
No, it's a component library, it isn't based on classes
You could try Angular Flex Layout for layout
 
2:08 PM
hi I have a silly question
lets say I have three input box, namely A, B and C
values of input box A is subtracted with the values of input box B and the difference were put into input box C
that is one instance
but what if I will create another instance with similar behavior
it can be done with using dynamically adding and removing element
now, my problem is on the second instance, I can easily get the difference of input box A with B but not put the result on the input box C
what it did was, the result on the first instance, or the values of input box C on the first instance was just copied on the input box C on the second instance.
the three input box where enclosed by tr(table row)
 
@aaa28 it's easy to do by making your script constrained by things like containers. You can further use data-* attributes to drive the behaviour, if you wish. Give me few minutes to whip up an example.
 
ok thanks
actually I solved the initial problem with using tr:last
now another problem emerge, when I get back to the first instance to change, lets say either the value of A or B, it do not work anymore
initially there are no table row, or input boxes, there were only an Add button that when clicked, creates or append an html element of table rows that contain input boxes
I wonder how can I assign something on a something that does not exist yet in the first place
let say that the html element I am going to append is this <tr><td><input type="number" id="instance_one" class="instance_one></td></tr>
on the second instance, when a user clicked Add, to create another instance, it will only re-create the same html element on the first instance. it will then have similar id or class
the result from subtracting values from input box A with B has no way of knowing which input box C to go to,
 
but I wonder, why does the problem occur on the input box C and not in A or B
ok ill check it
wow this has the potential to solve my problem, I just need to learn and understand it so I can be able to integrate it with what I have in mind, thank you very much @VLAZ
 
2:53 PM
@VLAZ honestly I do not understand any of it, it is way above of what my knowledge about javascript, so I will take this opportunity to ask how can I remove the calculate button, I mean the code would automatically run maybe on change or on blur whenever a user put value on either box A or box B
 
3:18 PM
@VLAZ wow! it does work perfectly, thank you very much, but problem is I do not understand it, but the good thing is you give me an idea on what to study, in a way you did not just give me a fish, neither teach me how to fish, but what you did was lead me to where I can learn how to fish, does that make sense? anyway thank you again....
 
The idea is simple enough. When the event fires, you go up to find the <tr> tag then from it you lookup the box A, B, and C inside. Since you're limiting to only elements within the same <tr> you're not going to cross over to other ones.
This version is doing hardcoded things - go up to get the parent twice to get the <tr> since the first .parentNode gives you the <td> If you're using jQuery, it's even simpler, since you can just call $(this).closest("tr") and you don't have to know how many tags you need to go up.
 
wow thank you for the explanation, I can comprehend it now quite a bit , maybe I would try jquery, if it is what you say it is, simpler. Thank you.
 
3:51 PM
@VLAZ another thanks for you, I have another predicament, similar to previous one, I am working on it now based on your suggestion
 
4:26 PM
hi
@VLAZ hey can you check this out , if you have time jsbin.com/siqurunaza/edit?html,js,output
lets say I clicked add, a new table row will appear, and let say on first column I will choose Company A, Product A1, now let say I will add another table row, this time I will choose Company B, then Product B1.
The problem occur when I chose the second company, the selection on the first product immediately reset and populated with option that should only be available at Company B, and then when I go back to the first instance, and change the Company from A to B, the selection on Product on the second instance get reset
 
That's because you use $('.product').html(options) to update the options and it's updating all product fields in the entire table. In order to be safe, you can use the same as what I showed you to only contain the nearest: $(this).closest("tr").find('.product').html(options); this only updates the product field in the current row. See here
 
4:57 PM
As a separate note, I dislike creating HTML as string. It works and it's easy but then it becomes hard to maintain. If you add one more tag, you may forget to close it, for example. It's also a big security issue. You can generate the elements programmatically which takes slightly more time upfront but it then guarantees that the HTML is correct, you don't have misplaced tags, nor misplaced quotes, or attributes, etc.
Finally, you don't have to worry about security as much, since a lot of the input will be automatically sanitised. Raw HTML that you create is fine as long as you're in control of every step of its generation. If you ever use some sort of user input or outside data during generation, you're in danger.
Using stuff like .text() and .val() to set the text and value of a node will not allow tainted input. It's easier to analyse what's happening, as well when you have very big HTML blocks.
 
wow you made it the way I imagine, and thank you for the advice
 
5:17 PM
@MyWrathAcademia awesome thanks
 

« first day (3507 days earlier)      last day (1444 days later) »