Results 1 to 7 of 7

Thread: auto reload grid data strange error

  1. #1

    Question auto reload grid data strange error

    Hello, I'm a fairly light weight developer so please let me know if i'm doing something wrong....

    Anyways i have a grid that i'm filling with an XMLReader and i would like to auto reload or refresh that data every 5 sec or so...

    so i setup a update manager on the grid object and called startAutoRefresh(5,loadCalls); where loadCalls is a function that just reloads the data.Store object... however this returns a weird firebug error of

    uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) []" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: javascript: eval(__firebugTemp__); :: anonymous :: line 1" data: no]
    I'm not entirely sure what this is or why it's happening... if i hook the same function into a on click event then it works just fine.

    here is my grid definition:

                           call =[
                                    {name: 'CallerId', mapping: 'CallerId'},
                                    {name: 'Status', mapping: 'Status'},
                                    {name: 'Queue', mapping: 'Queue'}
                            // create the Data Store
                            ds = new{
                                    // load using HTTP
                                    proxy: new{url: 'modules/helpdesk.php?a=listCalls'}),
                                    // the return will be XML, so lets set up a reader
                                    reader: new{
                                            record: 'Call',
                                            id: 'UniqueId',
                                            }, call ) 
                            var cm = new Ext.grid.ColumnModel([
                                    {header: "CallerId", width: 120, dataIndex: 'CallerId'},
                                    {header: "Status", width: 180, dataIndex: 'Status'},
                                    {header: "Queue", width: 115, dataIndex: 'Queue'}
                            cm.defaultSortable = true;
                            // create the grid
                            var grid = new Ext.grid.Grid('grid-example', {
                                    ds: ds,
                                    cm: cm
                            var calls_mgr = Ext.get('grid-example').getUpdateManager();
                            calls_mgr.startAutoRefresh(5,function () { ds.reload(); });
    i took out the loadCalls function here and just made it inline but neither way seems to work.

    (by the way if you can't tell... this is basically a copy paste from the example grid )
    any ideas?

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007


    I have a hint (untested).

    UpdateManager is bound to an element and it is primarily designed to update the element's content. Let's say you have a div (container) and you want to set the content of that div with data (html markup) from a server.

    Now, in your code you get the UpdateManager of the grid's container and I guess this could be the source of the problem.

    Maybe you could create an empty hidden div, get update manager of that div and start autorefresh.

    Try, I hope this helps.

  3. #3


    welp thanks for the hint... that does seem to work in terms of it now updates the data store object and redraws the grid... however i'm still getting that error every 5 secs, which occurs at the end of the function right after the ds.reloads();

    So i'm not sure if this is a Ext error or something in firebug...

  4. #4


    I ran across this forum post and Animals solution seems to do the same work but without the errors... i'm still not sure why those errors appear, but if anyone else is interested in a solution that post seems to have it.

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007


    My solution works because It's not using an UpdateManager.

    Your solution uses UpdateManager which pulls a data String from a specified URL and puts it into the innerHTML of its Element. That's not what you want is it?

    The URL will be undefined because you pass the result of a void function call as the URL parameter. So when the UpdateManager tells the XMLHttpRequest to open that URL, not surprisingly, it throws an error.

  6. #6

    Question what was animal's solution to the problem

    can you kindly let me know what the solution was that animal proposed... as i am having the same problem and would like to use animal's solution


  7. #7

    Default good solution

    thanx it works....

Posting Permissions

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