jQWidgets Forums

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts

  • andrea
    Participant

    Hi Dave Roth,
    could you provide a small example of your wrapper functions with the workaround solution ?
    I also agree that the clean up should be done by the widgets components directly when they are destroyed.

    I have a similar memory leak problem with the jqxgrid (5.6.0) in Angular 5.2.9 in a single page application.
    Basically if the grid contains at least one column with ‘createwidget’ defined (even if the function is empty) then the component is not removed from the browser memory when it is destroyed.
    So the memory usage keeps growing when switching from one page to another.

    Thanks and Regards
    Andrea


    andrea
    Participant

    Thank you very much Ivo, it works now with –aot=false
    Also I didn’t notice much difference in page loading time or code size with this option.
    it looks the same and the problem is gone.

    Thanks
    Andrea


    andrea
    Participant

    Actually the problem is the same also without the grid, see the small example below.
    Is it possible that some part of the code is missing from the production build or it’s something related to the minifier/compiler ?
    Thanks
    Andrea

    
    <div id="sliderContainer">
       <div id="slider"></div>
    </div>
    
    ngAfterViewInit() {
          var options= {
                  width: '100px', tooltip: true, showRange: false, showButtons: false, mode: 'fixed', template: 'primary', 
                  step:1, ticksFrequency: 1, min: 0, max : 1, value: 0
          };
          let mySlider : jqwidgets.jqxSlider = jqwidgets.createInstance('#slider', 'jqxSlider', options);
    }
    
    Error from the browser:
    
    ERROR TypeError: e(...)[i] is not a function
        at Object.createInstance (main.4e21ea489ac1b9131871.bundle.js:1)
        at e.ngAfterViewInit (main.4e21ea489ac1b9131871.bundle.js:1)
        at Rr (main.4e21ea489ac1b9131871.bundle.js:1)
        at zr (main.4e21ea489ac1b9131871.bundle.js:1)
        at Hr (main.4e21ea489ac1b9131871.bundle.js:1)
        at cn (main.4e21ea489ac1b9131871.bundle.js:1)
        at wn (main.4e21ea489ac1b9131871.bundle.js:1)
        at xn (main.4e21ea489ac1b9131871.bundle.js:1)
        at cn (main.4e21ea489ac1b9131871.bundle.js:1)
        at wn (main.4e21ea489ac1b9131871.bundle.js:1)
    Z @ main.4e21ea489ac1b9131871.bundle.js:1
    e.handleError @ main.4e21ea489ac1b9131871.bundle.js:1
    (anonymous) @ main.4e21ea489ac1b9131871.bundle.js:1
    e.invoke @ polyfills.abdf53ca655716e505e0.bundle.js:1
    t.run @ polyfills.abdf53ca655716e505e0.bundle.js:1
    e.runOutsideAngular @ main.4e21ea489ac1b9131871.bundle.js:1
    e.tick @ main.4e21ea489ac1b9131871.bundle.js:1
    (anonymous) @ main.4e21ea489ac1b9131871.bundle.js:1
    e.invoke @ polyfills.abdf53ca655716e505e0.bundle.js:1
    onInvoke @ main.4e21ea489ac1b9131871.bundle.js:1
    e.invoke @ polyfills.abdf53ca655716e505e0.bundle.js:1
    t.run @ polyfills.abdf53ca655716e505e0.bundle.js:1
    e.run @ main.4e21ea489ac1b9131871.bundle.js:1
    next @ main.4e21ea489ac1b9131871.bundle.js:1
    t.object.n @ main.4e21ea489ac1b9131871.bundle.js:1
    t.__tryOrUnsub @ main.4e21ea489ac1b9131871.bundle.js:1
    t.next @ main.4e21ea489ac1b9131871.bundle.js:1
    t._next @ main.4e21ea489ac1b9131871.bundle.js:1
    t.next @ main.4e21ea489ac1b9131871.bundle.js:1
    t.next @ main.4e21ea489ac1b9131871.bundle.js:1
    t.emit @ main.4e21ea489ac1b9131871.bundle.js:1
    Ae @ main.4e21ea489ac1b9131871.bundle.js:1
    onHasTask @ main.4e21ea489ac1b9131871.bundle.js:1
    e.hasTask @ polyfills.abdf53ca655716e505e0.bundle.js:1
    e._updateTaskCount @ polyfills.abdf53ca655716e505e0.bundle.js:1
    t._updateTaskCount @ polyfills.abdf53ca655716e505e0.bundle.js:1
    t.runTask @ polyfills.abdf53ca655716e505e0.bundle.js:1
    v @ polyfills.abdf53ca655716e505e0.bundle.js:1
    t.invokeTask @ polyfills.abdf53ca655716e505e0.bundle.js:1
    _ @ polyfills.abdf53ca655716e505e0.bundle.js:1
    k @ polyfills.abdf53ca655716e505e0.bundle.js:1
    

    andrea
    Participant

    What worked for me was this code:

    
    get ngValue(): any {
           if (this.widgetObject) {
               const value = this.host.val();
               if(typeof value === 'object'){
                   return '';
               }
               return value; 
           }
           return '';
       }
    

    Thanks for the guide.


    andrea
    Participant

    I have tried with ngModelChange event but the input contains the correct value I enter. I can’t detect any [object Object] value in order to override it. Please provide me with a specific example.


    andrea
    Participant

    After some investigation I found out that this seams to be a known issue in typescript, described here:

    typescript-class-method-this

    As described in the link a possible workaround is to change the method signature as follow:

    
    onSaveContinue = () => {
      if (this.user.username==null) {
         ….
      }
    }

    This works properly with onSuccess:
    this.myValidator.onSuccess(this.onSaveContinue);

Viewing 6 posts - 1 through 6 (of 6 total)