Results 1 to 3 of 3

Thread: success callback gone from Ext Direct?

  1. #1
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    20
    Answers
    1

    Default success callback gone from Ext Direct?

    Hello,

    we are using Ext Direct in our application, which currently runs on ExtJs 5. We are planning on upgrading to ExtJs 6.x - and I am asking myself if the success callback is gone from the API.

    For a (hypothetical) example
    Code:
    Ext.rpc.Application.index(null, { 
               success: function (reply) {
                    console.log(reply);
                }
            });
    works fine in our ExtJs 5 application.

    Yet the same code leads to a
    Code:
    Callback argument is not a function for Ext Direct method Application.index
    error in ExtJs 6 classic (and probably modern as well).

    Am I doing something wrong, or am I missing something?

    Thanks in advance for your help.

    UPDATE:

    I have dug into the code and there is a section in the "Ext.direct.RemotingProvider" class that seems to be responsible for this behaviour:
    Code:
    if (cb && !Ext.isFunction(cb)) {
        Ext.raise("Callback argument is not a function " +
            "for Ext Direct method " +
             action + "." + method.name);
    }
    If I comment out this section in an override, the behaviour is exactly as it was in ExtJs 5, i. e. it is possible to use dedicated success and failure listeners - which in my opinion is a huge advantage over having to always check for success in every callback.

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006
    Answers
    5

    Default

    Thank you for providing those examples. I have sent this over to the support team to look into. We appreciate your patience.

    Kind Regards,
    Michele

  3. #3
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    569
    Answers
    7

    Default

    Hello,

    Please see the documentation link, it will help you to understand the changes
    https://docs.sencha.com/extjs/6.0.0/...ml#cfg-actions

    Regards,
    Kumar
    Sencha Support.

Posting Permissions

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