Refresh grid

Hi there.

How can i refresh my grid automtically every 30 second?

currently im using window.setTimeout, but it giving me error wich is “doXPath(…) is null or not an object”

thanks for ur kind help :slight_smile:

i have another problem. I was trying to load my xml but it comes out tis error before i could load it.

“Not an xml,probably incorrect content type specified(must be text/html)”
What should i take not of this?
it will load but after a while it will show me “DoXPAth(…) is null or not an object”
ANybody can help me?
thanks!

“doXPath(…) is null or not an object”
Such issue may occur if you load incorrect XML into the grid. Please find reasons of incorrect xml error here docs.dhtmlx.com/doku.php?id=dhtm … leshooting

i have checked and my xml has no problem at all. and the error message pop up again after an hour as i have set timer to refresh my xml every 10 second.

any idea?
plz help. Thanks!

You can try to catch “Incorrect XML” error with following code:

dhtmlxError.catchError("LoadXML",function(a,b,data){ //data[0] - request object //data[0].responseText - incorrect server side response ... any kind of custom logic here ... });

I want to refresh my grid but I don’t know how I open a child window change data and then call a

window.opener.callFunction()

in the parent window I have:

function Callfromchild() {
mygird.init();
}

Anyone has done this before?
I can’t use the one used in the tutorial…because I’m using a normal html form in a child pop-up window.

var dpf = new dataProcessor("xml/contact_details.php");
dpf.init(contactForm);
dpf.attachEvent("onAfterUpdate",function(sid,action,tid,xml_node){
    contactsGrid.cells(sid,0).setValue(contactForm.getItemValue("fname"));
    contactsGrid.cells(sid,1).setValue(contactForm.getItemValue("lname"));
    contactsGrid.cells(sid,2).setValue(contactForm.getItemValue("email"));
})

Sorry I got some code wrong the correct one is:

function callFunction() {
mygird.init();
}

Ok, I found the answer… I did the following…

In the function in the parent window I used:

function callFunction() {
mygrid.clearAll();
mygrid.load("dbconnecter.php");
}

And in the child window I called the function with:

window.opener.callFunction();