Results 1 to 4 of 4

Thread: [4.1] Ext.util.TaskRunner complains destroy is not a function while destroying

    Success! Looks like we've fixed this one. According to our records the fix was applied for a bug in our system in a recent build.
  1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    126
    Vote Rating
    3
      0  

    Default [4.1] Ext.util.TaskRunner complains destroy is not a function while destroying

    REQUIRED INFORMATION

    Ext version tested:

    • Ext 4.1

    Browser versions tested against:
    • Firexfox 12
    • Chrome 19
    • IE9

    DOCTYPE tested against:
    • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    Description:
    • As per documentation http://docs.sencha.com/ext-js/4-1/#!...til.TaskRunner . You can create and start Task like this
      PHP Code:
       var task Ext.TaskManager.start({runupdateClock,interval1000}); 
      .
    • and stop the task like this
      PHP Code:
      task.destroy(); 
      but it complains that destroy is not a function.


    Steps to reproduce the problem:
    • Simply run the test case provided

    The result that was expected:
    • Task should have been stopped and destroyed

    The result that occurs instead:
    • Undefined function

    Test Case:
    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml"><head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <
    title>Position Test</title>
    <
    link rel="stylesheet" type="text/css" href="http://cdn.sencha.io/ext-4.1.0-gpl/resources/css/ext-all.css">
    <
    script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
    <script type="text/javascript" src="http://cdn.sencha.io/ext-4.1.0-gpl/ext-all.js"></script>
    <style type="text/css">
    .target
    {
        height: 75px;
        width: 75px;
        background-color: #000;
        position: absolute;
        top: 0px;
        left: 0px;
    }
    </style>
    </head>
    <body>

    <div id="target" class="target"></div>

    <script type="text/javascript">
    Ext.onReady(function()
    {
        var pos = 0;
        
        var task = Ext.TaskManager.start
        ({
            run: function()
            {
                pos++;
                Ext.fly('target').setStyle('top', pos+'px');
            },
            interval: 1000
        });
        
        task.destroy();
    });
    </script>
    </body>
    </html> 
    Operating System:
    • Win7 Pro
    Last edited by nicholasnet; 24 May 2012 at 5:42 PM. Reason: Added version

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,714
    Vote Rating
    893
      0  

    Default

    That's a bug in the docs. It should be:

    Code:
    Ext.TaskManager.stop(task);
    Will update it.
    Evan Trimboli
    Twitter - @evantrimboli

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2014
    Posts
    3
    Vote Rating
    0
      0  

    Default

    It's still not updated! Documentation still says we should task.destroy();

  4. #4

Posting Permissions

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