How to make Dajax callback into scoped object

Posted by BozoJoe on Stack Overflow See other posts from Stack Overflow or by BozoJoe
Published on 2010-05-20T17:13:01Z Indexed on 2010/05/20 17:20 UTC
Read the original article Hit count: 218

Filed under:
|
|

I cant seem to find a way to make django-dajaxice have its callback inside same scoped object from which made the initial call.

 MyViewport = Ext.extend(MyViewportUi, {
    initComponent: function() {
        MyViewport.superclass.initComponent.call(this);
    },

    LoadRecordsCallback: function(data){
       if(data!='DAJAXICE_EXCEPTION')
      { alert(data); }
      else
      { alert('DAJAXICE_EXCEPTION'); }  
    },

    LoadRecords: function(){
      Dajaxice.Console.GetUserRecords(this.LoadRecordsCallback);
    }
 });

 var blah = new MyViewport();
 blah.LoadRecords();

I'm on django, and like the calling syntax to django-dajaxice. I'm using Extjs 3.2 and tried passing a Ext.createCallback but Dajax's returning eval seems to only want a string for the callback.

© Stack Overflow or respective owner

Related posts about django

Related posts about extjs