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

Re: [ydn-javascript] Re: datatable sendRequest and panel loading working together

Expand Messages
  • Satyam
    The refresh method was renamed render recently so the refreshEvent is now renderEvent. Something I haven t tested but I think might work nicely is to use
    Message 1 of 5 , Dec 7, 2008
    • 0 Attachment
      The refresh method was renamed render recently so the refreshEvent is
      now renderEvent. Something I haven't tested but I think might work
      nicely is to use disableEvent and undisableEvent. This are new to 2.6
      and I think that they cover all situations when the DataTable might be
      unavailable for whatever reason, which is what you are looking for.
      Give it a try and let us know to confirm that's the right place to hook.

      Satyam

      larry_kluger wrote:
      > Hi All,
      >
      > Number one, please add me to Satyam and Jenny's list of admirers.
      >
      Thanks


      > I used Satyam's updated articles for my first YUI datatable
      > implementation and it's all working great! It's a large table, so I
      > need to add some spinners during calculations.
      >
      > My question is:
      > Which are the correct events to subscribe to for the following UI:
      >
      > 1) hide a 'loading spinner' after the initial data fetch has been
      > completed, the data table rendered, everything is now ready for the
      > user.
      > event postRenderEvent ?
      >
      >
      > 2) put up a 're-calculating spinner' when the user requests a column
      > sort.
      > event beforeSortedByChange ?
      >
      >
      > 3) hide the spinner after the column sort is complete.
      > Again event postRenderEvent ?
      >
      >
      > Satyam's message, below, refers to the "refreshEvent" but it appears
      > to be an undocumented event. Is it still current in 2.6.0? It isn't on
      > the api page.
      >
      > Ref: http://developer.yahoo.com/yui/docs/YAHOO.widget.DataTable.html
      >
      > Thanks,
      >
      > Larry K
      > New York City
      >
      >
      >
      > --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
      >
      >> The way you have it, the hide would be executed right after the
      >>
      > request for
      >
      >> the new data is posted but well before the reply comes back and gets
      >> processed. You might want to hide it when the refreshEvent is
      >>
      > triggered,
      >
      >> which will happen when the data is shown. This event also gets
      >>
      > triggered in
      >
      >> several other instances, like column sorts and such, but hiding
      >>
      > what's
      >
      >> already hidden won't hurt anything.
      >>
      >>
      >>
      > http://developer.yahoo.com/yui/docs/YAHOO.widget.DataTable.html#refres
      > hEvent
      >
      >> Satyam
      >>
      >> ----- Original Message -----
      >> From: "karla.valencia" <karla.valencia@...>
      >> To: <ydn-javascript@yahoogroups.com>
      >> Sent: Monday, January 28, 2008 8:47 PM
      >> Subject: [ydn-javascript] datatable sendRequest and panel loading
      >>
      > working
      >
      >> together
      >>
      >>
      >>
      >>> Hi everybody, I've got this problem.
      >>>
      >>> I make a call in my script like this:
      >>> myDataTable.getDataSource().sendRequest(newRequest,
      >>> myDataTable.onDataReturnInitializeTable, myDataTable);
      >>>
      >>> and it works OK. My problem is that I would like to display a
      >>>
      > panel
      >
      >>> this way ---> panel_loading.show(), while the request
      >>> is being loaded, and when finished I would like to hide it, this
      >>> way---> panel_loading.hide().
      >>>
      >>> I already have the "panel_loading" in my script. My question is
      >>>
      > where
      >
      >>> I should call the "panel_loading.show()" and
      >>> "panel_loading.hide()" functions.
      >>>
      >>> I already have a function like this:
      >>>
      >>> var OnUpdate = function ( o ) {
      >>>
      >>> var SQL = YAHOO.util.Dom.get("outputDivUpdates").innerHTML;
      >>>
      >>> var numReg = document.getElementById("selectNumReg").value;
      >>> var newRequest = "updates=" + SQL +"&startIndex=0" + "&results=" +
      >>> numReg;
      >>>
      >>>
      >>> panel_loading.show();
      >>>
      >>> myDataTable.getDataSource().sendRequest(newRequest,
      >>> myDataTable.onDataReturnInitializeTable, myDataTable);
      >>>
      >>> panel_loading.hide();
      >>>
      >>>
      >>> };
      >>>
      >>> in which I call "panel_loading.show()" before the request and
      >>> "panel_loading.hide()" after the request. I'm not sure this is the
      >>> rigth way to do I want to accomplish.
      >>>
      >>> Any help is greatly appreciated.
      >>>
      >>> Thanks.
      >>>
      >>>
      >>>
      >>>
      >>>
      >>>
      >>>
      >>>
      >>> Yahoo! Groups Links
      >>>
      >>>
      >>>
      >>>
      >>>
      >>> --
      >>> No virus found in this incoming message.
      >>> Checked by AVG Free Edition.
      >>> Version: 7.5.516 / Virus Database: 269.19.13/1246 - Release Date:
      >>> 27/01/2008 18:39
      >>>
      >>>
      >>>
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - http://www.avg.com
      > Version: 8.0.176 / Virus Database: 270.9.15/1834 - Release Date: 06/12/2008 16:55
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.