Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails MVC客户端控制器成功方法中的ExtJS4.1可以';t调用此控制器中的其他函数_Grails_Extjs - Fatal编程技术网

Grails MVC客户端控制器成功方法中的ExtJS4.1可以';t调用此控制器中的其他函数

Grails MVC客户端控制器成功方法中的ExtJS4.1可以';t调用此控制器中的其他函数,grails,extjs,Grails,Extjs,我正在使用Grails2.1.0和ExtJS4.1.0。现在我在这里面临一些关于成功方法的问题。问题在下面注释中的代码中。有人能帮我吗 onupdateOrder : function(invoiceid, payMethod, rebatevalue){ if(invoiceid > 0){ Ext.Msg.confirm('Update Product', 'Are you sure?', function (button) {

我正在使用Grails2.1.0和ExtJS4.1.0。现在我在这里面临一些关于成功方法的问题。问题在下面注释中的代码中。有人能帮我吗

 onupdateOrder : function(invoiceid, payMethod, rebatevalue){        
    if(invoiceid > 0){
        Ext.Msg.confirm('Update Product', 'Are you sure?', function (button) {
            if (button == 'yes') { 
                var invoice = Ext.create('Ext4Example.model.Invoice',{
                    id        : invoiceid,
                    rebate    : rebatevalue,
                    paymethod : payMethod
                });

                invoice.save({
                    success: function(model) {
                        var inId = model.getId();
                        this.updateOrder(invoiceid); //warning:this.updateOrder is not a function 
                    },
                    failure: function(){                           
                        console.log('Unable to save/update');
                    }
                });
            }
        }, this);
    }else{
        Ext.Msg.alert("Please Give Invoice Id");
    }
},
updateOrder :function(invoiceid){         
    var order = Ext.create('Ext4Example.model.Order',{
        id  : invoiceid
    });
    order.save({
        success: function(order) {
            console.log(invoiceid);
            Ext.getCmp('InvoiceNo').setValue(invoiceid);
            Ext.getCmp('itemform2').restoreItem();
        },
        failure: function(){
            console.log('Unable to update');
        }
    });
}
您需要指定

scope: this
在invoice.save()方法上,以便回调在控制器范围内运行