0
I have the following line in my code:
document.all['grid_tipo_prestador_' + ind_operadora].object = new _gridlist(document.all['grid_tipo_prestador_' + ind_operadora]);
I confess, I have no idea where it comes from _gridlist
. See that I have one new _gridlist(...)
, now that _gridlist
in this file only appears on this line and in the other files, both in the caller and in the auxiliary there is this guy. How can I give a new one that way? When we use C#, we give a new one in an existing class, now in Javascript I don’t know what happens here. As Javascript is very dynamic and its object orientation is a little different from C#, suddenly it allows you to create a type dynamically, different from C# that I need to instantiate a previously existing class. I’d like to understand that.
technically Javascript is not object oriented, but prototypes.
– Tobias Mesquita
pnet, in any of the files
*.js
must have some kind of statementvar _gridlist = function() { ... }
, is at this point that the_gridlist
is created. If you want to read more about, I advise this the following article– Tobias Mesquita
@Tobymosque, that’s what I meant and ran away at the time of the post. Being prototype oriented, does this allow the creation of objects dynamically? Because in javascript, I can say that there are no classes?
– pnet
@Tobymosque, you’re right. It’s in the . js file referring to the grid in question. Your comment to me is the answer. I was preceded in posting. I apologize for the rashness.
– pnet
In Ecmascript 5, there is no class definition, so what you can do are objects and understand them using prototypes, in Ecmascript 6 you can create classes, but most modern browsers still don’t have ES6 support
– Tobias Mesquita
@Tobymosque, man once again you saved my homeland. Thank you. As I said, your comment that is voted, solved my situation.
– pnet