Extjs 4.2: How to send parameters properly in a Ext.Ajax.Request POST

后端 未结 3 486
走了就别回头了
走了就别回头了 2021-02-05 23:14

I have to do a POST from my ExtJs script in order to delete something from my DB:

Ext.Ajax.request({
    url: \'deleteRole.html\',
    method: \'POST\',                   


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-05 23:47

    I solved it with the following code:

    var rolename = 'myRol';
    Ext.Ajax.request({
        url: 'deleteRole.html',
        method: 'POST',          
        params: {
            rolename: rolename
        },
        success: received,                                    
        failure: function(){console.log('failure');}
    });
    

提交回复
热议问题