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

datatable sendRequest and panel loading working together

Expand Messages
  • karla.valencia
    Hi everybody, I ve got this problem. I make a call in my script like this: myDataTable.getDataSource().sendRequest(newRequest,
    Message 1 of 5 , Jan 28, 2008
    • 0 Attachment
      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 what I want to accomplish, because the way I wrote it
      doesn't work.

      Any help is greatly appreciated.

      Thanks.
    • Satyam
      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.
      Message 2 of 5 , Jan 29, 2008
      • 0 Attachment
        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#refreshEvent

        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
        >
        >
      • karla.valencia
        Thanks, Satyam. I did something like this: this.myDataTable.subscribe( refreshEvent , function(oArgs) { panel_loading.hide(); }); and now my script works as I
        Message 3 of 5 , Jan 30, 2008
        • 0 Attachment
          Thanks, Satyam. I did something like this:

          this.myDataTable.subscribe("refreshEvent", function(oArgs) {

          panel_loading.hide();

          });

          and now my script works as I expected.

          Karla



          --- 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#refreshEvent
          >
          > 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
          > >
          > >
          >
        • larry_kluger
          Hi All, Number one, please add me to Satyam and Jenny s list of admirers. I used Satyam s updated articles for my first YUI datatable implementation and it s
          Message 4 of 5 , Dec 6, 2008
          • 0 Attachment
            Hi All,

            Number one, please add me to Satyam and Jenny's list of admirers.

            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
            > >
            > >
            >
          • 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 5 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.