Announcement

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

    TypeError: this.removeAt is not a function

    Hello,

    I take the "Master Detail" sample from the Showcase and added a Delete button. The sample uses client only datasource and data is feed with setTestData(...). When I press the delete button I got following exception:

    Code:
    Uncaught JavaScript exception [this.removeAt is not a function] in http://127.0.0.1:8888/test/sc/modules/ISC_Grids.js, line 45
    and following error in the development console:

    Code:
    01:31:26.501 [ERROR] [test] 01:31:26.500:TMR8:WARN:Log:TypeError: this.removeAt is not a function
        unnamed([object Array])
        Canvas.removeSelectedData()
        unnamed()
        unnamed([object GWTJavaObject], 786434, [object GWTJavaObject])
        unnamed(true)
        [c]Class.fireCallback(_1=>function (value),  _2=>"value",  _3=>[object Array],  _4=>{Obj},  _5=>undef)
        [c]Class.fireCallback(_1=>function (value),  _2=>"value",  _3=>[object Array])
        [c]Class.fireCallback(_1=>{Obj},  _2=>undef,  _3=>[object Array],  _4=>{Obj},  _5=>true)
        Timer._fireTimeout("$ir223")
        unnamed()
        unnamed()
    
    
    com.smartgwt.client.core.JsObject$SGWT_WARN: 01:31:26.500:TMR8:WARN:Log:TypeError: this.removeAt is not a function
        unnamed([object Array])
        Canvas.removeSelectedData()
        unnamed()
        unnamed([object GWTJavaObject], 786434, [object GWTJavaObject])
        unnamed(true)
        [c]Class.fireCallback(_1=>function (value),  _2=>"value",  _3=>[object Array],  _4=>{Obj},  _5=>undef)
        [c]Class.fireCallback(_1=>function (value),  _2=>"value",  _3=>[object Array])
        [c]Class.fireCallback(_1=>{Obj},  _2=>undef,  _3=>[object Array],  _4=>{Obj},  _5=>true)
        Timer._fireTimeout("$ir223")
        unnamed()
        unnamed()
    
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
        at java.lang.Thread.run(Thread.java:680)
    I'm using SmartGWT Pro 2.4.

    Is this some BUG ? Can I do some workaround ?

    Best Regards,
    paco

    #2
    I forgot to post my delete button action:

    Code:
      btnDelete.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            if (listGrid.getSelection().length <= 0) {
              SC.warn("No itmes selected");
              return;
            }
    
            SC.ask("Delete", "Do you really want to delete ?", 
                new BooleanCallback() {
                  public void execute(Boolean value) {
                    if (! value) {
                      return;
                    }
    
                    listGrid.removeSelectedData();
                  }
                });
          }
        });
    Any thoughts ?

    Best Regards

    Comment


      #3
      Hello,

      I managed to find the problem. I did ListGrid initialization with setSaveLocally(true). After I removed this everything is working fine.

      Best Regards

      Comment

      Working...
      X