Results 1 to 2 of 2

Thread: cannot pass the value of a variale to superclass.addOutput.apply

  1. #1
    Sencha User
    Join Date
    Aug 2013
    Vote Rating

    Default cannot pass the value of a variale to superclass.addOutput.apply

    Dear all,
    Im trying to code in opengeo framework which uses ext js 3.4. I want to create a welcome button that has as text the username. I managed to assign the username value to the global variable: user = record[0].data.username. Then, I also assigned it to the text property: this.text.
    However when I tried to override the properties myapp.plugins.Welcome.superclass.addOutput.apply, neither the global variable user or the assignment to this.text is recognized. Any idea what might be wrong...When I put in console the value of this variables the username is shown just before the call to myapp.plugins.Welcome.superclass.addOutput.apply
    Thanks in advance for your help.
    *@require plugins/Tool.js
    *@require GeoExt/widgets/Action.js
    var user;
    myapp.plugins.Welcome = Ext.extend(gxp.plugins.Tool, {
    ptype: "myapp_welcome",
    store: null,
    //text: null,
    //auth: null,
    addOutput: function(config) {
    //var user = this.text; = new{
    // store configs
    //autoLoad: true,
    url: 'login_handle.php',
    storeId: 'myStore',
    // reader configs
    root: 'results',
    idProperty: 'username',
    baseParams: {task: "LOGIN"},// parameter pass to the php file
    fields: ['username','pwd', 'php_session'],
    success: function(response, action) {
    var text = response.responseText;
    callback : function(record, operation, success) {
    user = record[0].data.username;

    this.text = user;
    var out = myapp.plugins.Welcome.superclass.addOutput.apply(this, [{
    text: this.text,
    scope: this
    return out;
    /*return, Ext.apply({
    text: this.text
    }, config));*/

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Boise, ID
    Vote Rating


    Hmm... not sure. Just to make sure we're working from the lowest common denominator can you create a full test case using only ExtJS (including parent and subclass code)?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts