Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Calling javascript methods

    Sometimes I need to overwrite methods e.g. from FormItem.js file.
    It's possible when in load_skin.js we redefine method e.g.

    isc.FormItem.addMethods({
    //some method
    })

    Generally it works, but it doesn't work where in the body of the overwritten method, invocation of some other methods from source class exists.
    These methods are distinctive, their names start with _ (underscore).

    e.g.
    var linkElement = this._getIconLinkElement(icon),
    imgElement = this._getIconImgElement(icon);

    When such invocation occurs then javascript exception is thrown with exception message like the following: this._getIconLinkElement(icon) is not a function.

    What does underscore in the method's name mean ?
    Is it a private method or something like that ?
    Last edited by behemot; 4 Nov 2010, 04:49.

    #2
    Methods that begin with an underscore are obfuscated in the minimized code and are considered internal.

    Comment


      #3
      Thanx for fast reply.

      But are there any possibilities to overwrite such metod or methods which invoke these internal methods ?

      Comment


        #4
        You are working with the internals which are subject to change. However, you can track down the obfuscated method name in the version you are running and call that. Be aware that the method name is subject to change in subsequent builds.

        Normal override points will not have this issue. If you can't accomplish what you want with those it's probably worthwhile to post what you are trying to do and find an alternate way.

        Comment

        Working...
        X