Loading ...
Sorry, an error occurred while loading the content.

18996Re: Problem with Datatable

Expand Messages
  • tanklm
    Oct 1, 2007
      I copied the local XML example from the examples page and plugged in
      my own xml file to read/write to/from. I'm using CGI to do the adds
      and deletes from the local xml file. I'm using Connection to read in
      the data. This GET reads from the cache whenever it can which is not
      what I want it to do.

      this.getXML = YAHOO.util.Connect.asyncRequest("GET", "data.xml",
      this.connectionCallback);


      --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
      >
      > Perhaps if you tell us what it is you are using someone with
      experience in
      > that language, framework or whatever might help you.
      >
      > Satyam
      >
      > ----- Original Message -----
      > From: "tanklm" <lynn@...>
      > To: <ydn-javascript@yahoogroups.com>
      > Sent: Monday, October 01, 2007 12:46 PM
      > Subject: [ydn-javascript] Re: Problem with Datatable
      >
      >
      > >
      > > I am having the same problem with a datatable that is similar to the
      > > Local XML example
      > >
      (http://developer.yahoo.com/yui/examples/datatable/dt_xhrlocalxml.html).
      > > It reads my xml file from cache unless I specifically clear the cache
      > > between reloads. I'm not using PHP. Where/How would I set these
      > > headers in this case?
      > >
      > > --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@> wrote:
      > >>
      > >> The problem is with caching. You can tell IE not to cache, which
      will
      > >> prevent it from caching everything from your site or others or you
      > > can send
      > >> the proper headers from the server side to tell the browser the
      page is
      > >> expired. In PHP you can do:
      > >>
      > >> header('Cache-Control: no-cache, must-revalidate'); //
      HTTP/1.1
      > >> header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in
      > > the past
      > >>
      > >> right before echoing any content. Those headers tell the browser
      > > (and any
      > >> intermediate caching proxy) that the page is not to be cached and,
      > > just in
      > >> case, that it has already expired.
      > >>
      > >>
      > >>
      > >> ----- Original Message -----
      > >> From: "garymtarr" <GaryTarr@>
      > >> To: <ydn-javascript@yahoogroups.com>
      > >> Sent: Wednesday, September 12, 2007 5:14 AM
      > >> Subject: [ydn-javascript] Problem with Datatable
      > >>
      > >>
      > >> > Hi,
      > >> >
      > >> > I am trying to refresh a datatable on a timed basis. However, each
      > >> > time I do the sendRequest, the same data is always returned. In
      > >> > fact, if the web server is stopped, I still get back the same data
      > >> > after the first request. It seems like the DataSource object is
      > >> > caching the first set of data but I can't figure out how to turn
      > >> > caching off. The documentation says that caching is turned off by
      > >> > default so I am confused. Any help would be appreciated. BTW,
      I am a
      > >> > new javascript programmer but have experience in other languages.
      > >> > Below is the code :
      > >> >
      > >> > Thanks in advance
      > >> > Gary
      > >> >
      > >> > var IsItUp={};
      > >> >
      > >> > IsItUp.DeviceViewRefreshTimeMS=30000;
      > >> >
      > >> > IsItUp.IsItUpData = [
      > >> > {Status:"0", DeviceGroup:"Main
      > >> > Office",DeviceName:"Exchange Server",UpDownTime:"5 Days 3 Hr 4
      Mn 18
      > >> >
      Sec",Address:"192.168.6.4",Availability:"93%",ResponseTimeAvg:"000:00:
      > >> > 01.382",MostRecentContact:"Wed Sep 5,2007 22:36"},
      > >> > {Status:"1", DeviceGroup:"Main
      Office",DeviceName:"Web
      > >> > Server",UpDownTime:"5 Days 3 Hr 4 Mn 18
      > >> >
      Sec",Address:"192.168.6.4",Availability:"93%",ResponseTimeAvg:"000:00:
      > >> > 01.382",MostRecentContact:"Wed Sep 5,2007 22:36"},
      > >> > {Status:"2",
      DeviceGroup:"Accounting",DeviceName:"File
      > >> > Server",UpDownTime:"5 Days 3 Hr 4 Mn 18
      > >> >
      Sec",Address:"192.168.6.4",Availability:"93%",ResponseTimeAvg:"000:00:
      > >> > 01.382",MostRecentContact:"Wed Sep 5,2007 22:36"},
      > >> > {Status:"3",
      > >> > DeviceGroup:"Accounting",DeviceName:"Print
      Server",UpDownTime:"5 Days
      > >> > 3 Hr 4 Mn 18
      > >> >
      Sec",Address:"192.168.6.4",Availability:"93%",ResponseTimeAvg:"000:00:
      > >> > 01.382",MostRecentContact:"Wed Sep 5,2007 22:35"},
      > >> > {Status:"0",
      > >> > DeviceGroup:"Development",DeviceName:"Exchange
      Server",UpDownTime:"5
      > >> > Days 3 Hr 4 Mn 18
      > >> >
      Sec",Address:"192.168.6.4",Availability:"93%",ResponseTimeAvg:"000:00:
      > >> > 01.382",MostRecentContact:"Wed Sep 5,2007 22:36"}
      > >> > ]
      > >> >
      > >> >
      > >> >
      > >> >
      > >> > YAHOO.util.Event.addListener(window, "load", function()
      > >> > {
      > >> > IsItUp.CreateDeviceViewTable = new function()
      > >> > {
      > >> >
      > >> > this.StatusColumnFormatter = function(elCell, oRecord,
      > >> > oColumn, oData)
      > >> > {
      > >> > if(oRecord.getData("Status")=="0")
      > >> > {
      > >> > elCell.innerHTML = ' <img
      > >> > src="arrow_up.ico">';
      > >> > }
      > >> > if(oRecord.getData("Status")=="1")
      > >> > {
      > >> > elCell.innerHTML = ' <img
      > >> > src="arrow_down.ico">';
      > >> > }
      > >> > if(oRecord.getData("Status")=="2")
      > >> > {
      > >> > elCell.innerHTML = ' <img
      > >> > src="arrow_testing.ico">';
      > >> > }
      > >> > if(oRecord.getData("Status")=="3")
      > >> > {
      > >> > elCell.innerHTML = ' <img
      > >> > src="disabled.ico">';
      > >> > }
      > >> >
      > >> > }
      > >> >
      > >> > var DeviceViewColumnDefs =
      > >> > [
      > >> >
      > >> >
      {key:"Status",label:"Status",formatter:this.StatusColumnFormatter,sort
      > >> > able:true, resizeable:true},
      > >> > {key:"DeviceGroup",label:"Device
      > >> > Group",sortable:true, resizeable:true},
      > >> > {key:"DeviceName",label:"Device Name",sortable:true,
      > >> > resizeable:true},
      > >> > {key:"UpDownTime",label:"Up/Down Time",
      > >> > sortable:true, resizeable:true},
      > >> > {key:"Address",sortable:true, resizeable:true},
      > >> > {key:"Availability", sortable:true,
      resizeable:true},
      > >> > {key:"ResponseTimeAvg",label:"Response Time (Avg)",
      > >> > sortable:true, resizeable:true},
      > >> > {key:"MostRecentContact",label:"Most Recent
      Contact",
      > >> > sortable:true, resizeable:true}
      > >> > ];
      > >> >
      > >> > this.oLogReader = new YAHOO.widget.LogReader();
      > >> > this.IsItUpDataSource = new YAHOO.util.DataSource("/?");
      > >> > this.IsItUpDataSource.responseType =
      > >> > YAHOO.util.DataSource.TYPE_JSON;
      > >> > this.IsItUpDataSource.connXhrMode = "queueRequests";
      > >> > this.IsItUpDataSource.responseSchema = {
      > >> > resultsList: "ResultSet",
      > >> > fields:
      > >> >
      ["Status","DeviceGroup","DeviceName","UpDownTime","Address","Availabil
      > >> > ity","ResponseTimeAvg","MostRecentContact"]
      > >> > };
      > >> >
      > >> > this.DeviceViewTable = new YAHOO.widget.DataTable("basic",
      > >> > DeviceViewColumnDefs,this.IsItUpDataSource,
      {initialRequest:"cmd=1"});
      > >> >
      > >> >
      > >> > this.RefreshDeviceView = function()
      > >> > {
      > >> > debugger;
      > >> >
      > >> > IsItUp.CreateDeviceViewTable.IsItUpDataSource.flushCache();
      > >> >
      > >> > IsItUp.CreateDeviceViewTable.IsItUpDataSource.sendRequest("cmd=1",
      > >> >
      IsItUp.CreateDeviceViewTable.DeviceViewTable.onDataReturnInitializeTab
      > >> > le,IsItUp.CreateDeviceViewTable.DeviceViewTable);
      > >> > var RefreshSpan =
      > >> > document.getElementById("NextRefresh");
      > >> > var NextRefresh = new Date
      > >> > ();
      > >> > var CurrentTimeMS =
      > >> > NextRefresh.getTime();
      > >> > NextRefresh.setTime
      > >> > (CurrentTimeMS + IsItUp.DeviceViewRefreshTimeMS);
      > >> > var HrMinSecToNextRefresh=
      > >> > NextRefresh.getHours() + ":" + NextRefresh.getMinutes() + ":" +
      > >> > NextRefresh.getSeconds();
      > >> >
      > >> > RefreshSpan.innerHTML=HrMinSecToNextRefresh;
      > >> > }
      > >> >
      > >> > setInterval("IsItUp.CreateDeviceViewTable.RefreshDeviceView
      > >> > ()",IsItUp.DeviceViewRefreshTimeMS);
      > >> >
      > >> >
      > >> >
      > >> >
      > >> >
      > >> > Yahoo! Groups Links
      > >> >
      > >> >
      > >> >
      > >> >
      > >> >
      > >> >
      > >> > --
      > >> > No virus found in this incoming message.
      > >> > Checked by AVG Free Edition.
      > >> > Version: 7.5.485 / Virus Database: 269.13.15/1002 - Release Date:
      > >> > 11/09/2007 17:46
      > >> >
      > >> >
      > >>
      > >
      > >
      > >
      > >
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > >
      > >
      > > --
      > > No virus found in this incoming message.
      > > Checked by AVG Free Edition.
      > > Version: 7.5.488 / Virus Database: 269.13.35/1040 - Release Date:
      > > 30/09/2007 21:01
      > >
      >
    • Show all 8 messages in this topic