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

Re: Issue with addRow() and pagination

Expand Messages
  • rashmeep2000
    Hi luke, will this work only with 2.5.2?...coz ur example is for 2.5.2 version...also do we need yahoo-dom-event.js for this feature?...coz i am not able to
    Message 1 of 13 , Jun 1, 2008
    • 0 Attachment
      Hi luke,
      will this work only with 2.5.2?...coz ur example is for 2.5.2
      version...also do we need yahoo-dom-event.js for this feature?...coz
      i am not able to find it in 2.5.1 which i am using...

      the problem i am facing is...the first time i click on addrow, it
      doesnot add row, but takes me to that page..also after the page has
      reached its max number of pages, it creates subsequest pages, but
      pagination does not work after that....is this prob bcoz i have
      combned inline edit also....not sure..please clarify...

      --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@...> wrote:
      >
      > Wow, typo. My apologies. rowAddEvent, not addRowEvent.
      >
      > Here's an example page:
      >
      http://yuiblog.com/sandbox/yui/v252/examples/datatable/addrow_pag.html
      >
      > Luke
      >
      > --- In ydn-javascript@yahoogroups.com, "Rashmi Y. Prasad"
      > <RPrasad2@> wrote:
      > >
      > > Luke,
      > >
      > > This is what I exactly tried, but "addRowEvent" never gets
      > > triggered....not sure if I am amking any mistake....please point
      out...
      > >
      > >
      > >
      > > YAHOO.util.Event.addListener("addrow","click",function() {
      > >
      > > var recoor = {"id":"","attribute1"};
      > >
      > > myDataTable.addRow(recoor);
      > >
      > > },this,true);
      > >
      > >
      > >
      > > myDataTable.subscribe('addRowEvent',function () {alert
      ("addRowEvent");
      > >
      > > myPaginator.setPage(myPaginator.getTotalPages(), false);
      > >
      > > }, myPaginator, true);
      > >
      > >
      > >
      > > Also, row sometimes comes up, sometimes its not shown, somehow it
      > > doesnot seem to be consistent:-(
      > >
      > >
      > >
      > > ________________________________
      > >
      > > From: ydn-javascript@yahoogroups.com
      > > [mailto:ydn-javascript@yahoogroups.com] On Behalf Of y_lsmith
      > > Sent: Friday, May 30, 2008 9:04 PM
      > > To: ydn-javascript@yahoogroups.com
      > > Subject: [ydn-javascript] Re: Issue with addRow() and pagination
      > >
      > >
      > >
      > > If you're trying to jump to the last page when you add a row, the
      > > following should be sufficient:
      > >
      > > myDataTable.subscribe('addRowEvent',function () {
      > > this.setPage(this.getTotalPages());
      > > }, myPaginator, true);
      > >
      > > YAHOO.util.Event.on('addrow','click',function () {
      > > var data = {};
      > > /* collect values for new row */
      > > myDataTable.addRow(data);
      > > });
      > >
      > > Hope this helps,
      > > Luke
      > >
      > > --- In ydn-javascript@yahoogroups.com
      > > <mailto:ydn-javascript%40yahoogroups.com> , "rashmeep2000"
      > > <RPrasad2@>
      > > wrote:
      > > >
      > > > hi all,
      > > > my addRow method looks like this...
      > > > YAHOO.util.Event.addListener("addrow","click",function() {
      > > > //var data=.....
      > > > totalRecordsMy = myPaginator.getTotalRecords()
      > > >
      > > > var toAdd = myPaginator.getTotalRecords()+1;
      > > >
      > > > totalRecordsMy = totalRecordsMy+1;//alert(totalRecordsMy);
      > > > myPaginator.setTotalRecords(totalRecordsMy, false);
      > > >
      > > > var toPage = totalRecordsMy/rowsPerPageMy;alert("toPage--
      "+toPage);
      > > >
      > > > myDataTable.addRow(recoor);
      > > > if(toPage > myPaginator.getTotalPages()){
      > > > myPaginator.setPage(myPaginator.getTotalPages()+1, false);
      > > > }else { myPaginator.setPage(myPaginator.getTotalPages(), false);
      > > > }
      > > >
      > > > },this,true);
      > > >
      > > > When i cleick on addor for first time, it doesnot add row, but
      goes
      > > > to next page, on second click it adds row, also i ahve 5
      rowsperpage,
      > > > after adding 5 rows, i keep clicking on addrow, it adds rows,
      but
      > > > doesnot paginate to the page in which it has added new row, i
      forced
      > > > my setting page, that is also not working.please help..thanks.
      > > >
      > >
      >
    • rashmeep2000
      sorry i found yahoo-dom-event.js...but my problem is still not solved :(...thanks in advance. ...
      Message 2 of 13 , Jun 1, 2008
      • 0 Attachment
        sorry i found yahoo-dom-event.js...but my problem is still not
        solved :(...thanks in advance.

        --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@...> wrote:
        >
        > Wow, typo. My apologies. rowAddEvent, not addRowEvent.
        >
        > Here's an example page:
        >
        http://yuiblog.com/sandbox/yui/v252/examples/datatable/addrow_pag.html
        >
        > Luke
        >
        > --- In ydn-javascript@yahoogroups.com, "Rashmi Y. Prasad"
        > <RPrasad2@> wrote:
        > >
        > > Luke,
        > >
        > > This is what I exactly tried, but "addRowEvent" never gets
        > > triggered....not sure if I am amking any mistake....please point
        out...
        > >
        > >
        > >
        > > YAHOO.util.Event.addListener("addrow","click",function() {
        > >
        > > var recoor = {"id":"","attribute1"};
        > >
        > > myDataTable.addRow(recoor);
        > >
        > > },this,true);
        > >
        > >
        > >
        > > myDataTable.subscribe('addRowEvent',function () {alert
        ("addRowEvent");
        > >
        > > myPaginator.setPage(myPaginator.getTotalPages(), false);
        > >
        > > }, myPaginator, true);
        > >
        > >
        > >
        > > Also, row sometimes comes up, sometimes its not shown, somehow it
        > > doesnot seem to be consistent:-(
        > >
        > >
        > >
        > > ________________________________
        > >
        > > From: ydn-javascript@yahoogroups.com
        > > [mailto:ydn-javascript@yahoogroups.com] On Behalf Of y_lsmith
        > > Sent: Friday, May 30, 2008 9:04 PM
        > > To: ydn-javascript@yahoogroups.com
        > > Subject: [ydn-javascript] Re: Issue with addRow() and pagination
        > >
        > >
        > >
        > > If you're trying to jump to the last page when you add a row, the
        > > following should be sufficient:
        > >
        > > myDataTable.subscribe('addRowEvent',function () {
        > > this.setPage(this.getTotalPages());
        > > }, myPaginator, true);
        > >
        > > YAHOO.util.Event.on('addrow','click',function () {
        > > var data = {};
        > > /* collect values for new row */
        > > myDataTable.addRow(data);
        > > });
        > >
        > > Hope this helps,
        > > Luke
        > >
        > > --- In ydn-javascript@yahoogroups.com
        > > <mailto:ydn-javascript%40yahoogroups.com> , "rashmeep2000"
        > > <RPrasad2@>
        > > wrote:
        > > >
        > > > hi all,
        > > > my addRow method looks like this...
        > > > YAHOO.util.Event.addListener("addrow","click",function() {
        > > > //var data=.....
        > > > totalRecordsMy = myPaginator.getTotalRecords()
        > > >
        > > > var toAdd = myPaginator.getTotalRecords()+1;
        > > >
        > > > totalRecordsMy = totalRecordsMy+1;//alert(totalRecordsMy);
        > > > myPaginator.setTotalRecords(totalRecordsMy, false);
        > > >
        > > > var toPage = totalRecordsMy/rowsPerPageMy;alert("toPage--
        "+toPage);
        > > >
        > > > myDataTable.addRow(recoor);
        > > > if(toPage > myPaginator.getTotalPages()){
        > > > myPaginator.setPage(myPaginator.getTotalPages()+1, false);
        > > > }else { myPaginator.setPage(myPaginator.getTotalPages(), false);
        > > > }
        > > >
        > > > },this,true);
        > > >
        > > > When i cleick on addor for first time, it doesnot add row, but
        goes
        > > > to next page, on second click it adds row, also i ahve 5
        rowsperpage,
        > > > after adding 5 rows, i keep clicking on addrow, it adds rows,
        but
        > > > doesnot paginate to the page in which it has added new row, i
        forced
        > > > my setting page, that is also not working.please help..thanks.
        > > >
        > >
        >
      • y_lsmith
        ... It will work for 2.5.1. yahoo-dom-event.js is a compressed rollup of yahoo.js, dom.js, and event.js. Can you provide a link to a page that reproduces the
        Message 3 of 13 , Jun 2, 2008
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, "rashmeep2000" <RPrasad2@...>
          wrote:
          >
          > Hi luke,
          > will this work only with 2.5.2?...coz ur example is for 2.5.2
          > version...also do we need yahoo-dom-event.js for this feature?...coz
          > i am not able to find it in 2.5.1 which i am using...
          >
          > the problem i am facing is...the first time i click on addrow, it
          > doesnot add row, but takes me to that page..also after the page has
          > reached its max number of pages, it creates subsequest pages, but
          > pagination does not work after that....is this prob bcoz i have
          > combned inline edit also....not sure..please clarify...
          >

          It will work for 2.5.1. yahoo-dom-event.js is a compressed rollup of
          yahoo.js, dom.js, and event.js.

          Can you provide a link to a page that reproduces the behavior? I
          believe the example page I provided behaves as you expect in regards
          to pagination and adding rows. Perhaps I'm not understanding what you
          want the DataTable to do.

          Luke
        • Rashmi Y. Prasad
          Hi Luke, Yes the example page works perfectly exactly I want my datatable to work, but my code doesnot seem to behave that way... This is my piece of code...
          Message 4 of 13 , Jun 2, 2008
          • 0 Attachment

            Hi Luke,

            Yes the example page works perfectly exactly I want my datatable to work, but my code doesnot seem to behave that way…

             

            This is my piece of code…

             

            var myDataSource = new DataSource("/kcm/ViewCatalog/CatalogViewGetCatalogLineItemsForEdit.do?");

             

            myDataSource.responseType = DataSource.TYPE_JSON;

            myDataSource.responseSchema = {

            resultsList: "records",

            fields: [ "id","editStatus",

                                    <c:forEach var="element1" items="${catalogLineItemHeaders}" varStatus="status">

                                    <c:choose>

                                    <c:when test = "${status.index < (fn:length(catalogLineItemHeaders)-1)}">"attribute<c:out value="${element1.columnNumber}"/>",</c:when>

             

                                    <c:otherwise>"attribute<c:out value="${element1.columnNumber}"/>"</c:otherwise>

                                    </c:choose>

             

                                     </c:forEach>

            ],

             

            metaFields : {

                                    totalRecords: "totalRecords" // The totalRecords meta field is

                                                                                                                          // a "magic" meta, and will be passed

                                                                                                                          // to the Paginator.

                        }

            };

             

            YAHOO.util.Event.addListener("addrow","click",function() {

             

            var recoor = {"id":"","attribute1":"","attribute2":"","attribute3":"","attribute4":"","attribute5":"","attribute6":"","attribute7":"","attribute8":"","attribute9":"","attribute10":"","attribute11":"","attribute12":"","attribute13":"","attribute14":"","attribute15":"","attribute16":"","attribute17":"","attribute18":"","attribute19":"","attribute20":"","attribute21":"","attribute22":"","attribute23":"","attribute24":"","attribute25":"","attribute26":"","attribute27":"","attribute28":"","attribute29":"","attribute30":"","attribute31":"","attribute32":"","attribute33":"","attribute34":"","attribute35":"","attribute36":"","attribute37":"","attribute38":"","attribute39":"","attribute40":"","attribute41":"","attribute42":"","attribute43":"","attribute44":"","attribute45":"","attribute46":"","attribute47":"","attribute48":"","attribute49":"","attribute50":"","attribute51":"","attribute52":"","attribute53":"","attribute54":"","attribute55":"","attribute56":""};

             

            myDataTable.addRow(recoor);

             

             

             

            },this,true);

             

             

             

            myDataTable.subscribe('rowAddEvent',function () {

                        this.setPage(this.getTotalPages());

            },myPaginator,true);

             

            Clicking on addrow adds row but doesnot show it on UI the first time, also wen the row is added in next page wrt current page, pagination stops working, and we cannot goto next page where row is added…please help…

             

             

             


            From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of y_lsmith
            Sent: Monday, June 02, 2008 8:18 PM
            To: ydn-javascript@yahoogroups.com
            Subject: [ydn-javascript] Re: Issue with addRow() and pagination

             

            --- In ydn-javascript@ yahoogroups. com, "rashmeep2000" <RPrasad2@.. .>
            wrote:

            >
            > Hi luke,
            > will this work only with 2.5.2?...coz
            w:st="on">ur example is for 2.5.2
            > version...also do we need yahoo-dom-event. js for this feature?...coz
            > i am not able to find it in 2.5.1 which i am using...
            >
            > the problem i am facing is...the first time i click on addrow, it
            > doesnot add row, but takes me to that page..also after the page has
            > reached its max number of pages, it creates subsequest pages, but
            > pagination does not work after that....is this prob bcoz i have
            > combned inline edit also....not sure..please clarify...
            >

            It will work for 2.5.1. yahoo-dom-event. js is a compressed rollup of
            yahoo.js, dom.js, and event.js.

            Can you provide a link to a page that reproduces the behavior? I
            believe the example page I provided behaves as you expect in regards
            to pagination and adding rows. Perhaps I'm not understanding what you
            want the DataTable to do.

            Luke

          • Rashmi Y. Prasad
            Luke, The problem I am having with paginator is, suppose I have 5 rows per page, In my second page I have just one row, I added 4 more rows using addorw, it
            Message 5 of 13 , Jun 2, 2008
            • 0 Attachment

              Luke,

              The problem I am having with paginator is, suppose I have 5 rows per page, In my second page I have just one row, I added 4 more rows using addorw, it works fine until then, but when the row is added in the 3rd page, paginator doensot move to 3rd page, even though it shows clearly the 3rd page, but pagination is not shifted to 3rd page…..this is wat is happening…

               


              From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of Rashmi Y. Prasad
              Sent: Monday, June 02, 2008 10:38 PM
              To: ydn-javascript@yahoogroups.com
              Subject: RE: [ydn-javascript] Re: Issue with addRow() and pagination

               

              Hi Luke,

              Yes the example page works perfectly exactly I want my datatable to work, but my code doesnot seem to behave that way…

               

              This is my piece of code…

               

              var myDataSource = new DataSource("/kcm/ViewCatalog/ CatalogViewGetCa talogLineItemsFo rEdit.do?");

               

              myDataSource. responseType = DataSource.TYPE_ JSON;

              myDataSource. responseSchema = {

              resultsList: "records",

              fields: [ "id","editStatus",

                                      <c:forEach var="element1" items="${catalogLineItemHe aders}" varStatus="status">

                                      <c:choose>

                                      <c:when test = "${status.index < (fn:length(catalogL ineItemHeaders) -1)}">"attribute<c:out value="${element1.columnNu mber}"/>",</c:when>

               

                                      <c:otherwise>"attribute<c:out value="${element1.columnNu mber}"/>"</c:otherwise>

                                      </c:choose>

               

                                       </c:forEach>

              ],

               

              metaFields : {

                                      totalRecords: "totalRecords" // The totalRecords meta field is

                                                                                                                            // a "magic" meta, and will be passed

                                                                                                                            // to the Paginator.

                          }

              };

               

              YAHOO.util.Event. addListener("addrow","click",function() {

               

              var recoor = {"id":"","attribute1":"","attribute2":"","attribute3":"","attribute4":"","attribute5":"","attribute6":"","attribute7":"","attribute8":"","attribute9":"","attribute10":"","attribute11":"","attribute12":"","attribute13":"","attribute14":"","attribute15":"","attribute16":"","attribute17":"","attribute18":"","attribute19":"","attribute20":"","attribute21":"","attribute22":"","attribute23":"","attribute24":"","attribute25":"","attribute26":"","attribute27":"","attribute28":"","attribute29":"","attribute30":"","attribute31":"","attribute32":"","attribute33":"","attribute34":"","attribute35":"","attribute36":"","attribute37":"","attribute38":"","attribute39":"","attribute40":"","attribute41":"","attribute42":"","attribute43":"","attribute44":"","attribute45":"","attribute46":"","attribute47":"","attribute48":"","attribute49":"","attribute50":"","attribute51":"","attribute52":"","attribute53":"","attribute54":"","attribute55":"","attribute56":""};

               

              myDataTable. addRow(recoor) ;

               

               

               

              },this,true) ;

               

               

               

              myDataTable. subscribe( 'rowAddEvent' ,function () {

                          this.setPage( this.getTotalPag es());

              },myPaginator, true);

               

              Clicking on addrow adds row but doesnot show it on UI the first time, also wen the row is added in next page wrt current page, pagination stops working, and we cannot goto next page where row is added…please help…

               

               

               


              From: ydn-javascript@ yahoogroups. com [mailto: ydn-javascript@ yahoogroups. com ] On Behalf Of y_lsmith
              Sent: Monday, June 02, 2008 8:18 PM
              To: ydn-javascript@ yahoogroups. com
              Subject: [ydn-javascript] Re: Issue with addRow() and pagination

               

              --- In ydn-javascript@ yahoogroups. com, "rashmeep2000" <RPrasad2@.. .>
              wrote:

              >
              > Hi luke,
              > will this work only with 2.5.2?...coz
              w:st="on">ur example is for 2.5.2
              > version...also do we need yahoo-dom-event. js for this feature?...coz
              > i am not able to find it in 2.5.1 which i am using...
              >
              > the problem i am facing is...the first time i click on addrow, it
              > doesnot add row, but takes me to that page..also after the page has
              > reached its max number of pages, it creates subsequest pages, but
              > pagination does not work after that....is this prob bcoz i have
              > combned inline edit also....not sure..please clarify...
              >

              It will work for 2.5.1. yahoo-dom-event. js is a compressed rollup of
              yahoo.js, dom.js, and event.js.

              Can you provide a link to a page that reproduces the behavior? I
              believe the example page I provided behaves as you expect in regards
              to pagination and adding rows. Perhaps I'm not understanding what you
              want the DataTable to do.

              Luke

              (Message over 64 KB, truncated)
            • y_lsmith
              I don t see your DataTable instantiation code. Have you tried stepping through the code in FireBug? If the example page works, then investigate the
              Message 6 of 13 , Jun 2, 2008
              • 0 Attachment
                I don't see your DataTable instantiation code. Have you tried
                stepping through the code in FireBug?

                If the example page works, then investigate the differences, or try
                reducing your page until it either works, or looks like the example.


                --- In ydn-javascript@yahoogroups.com, "Rashmi Y. Prasad"
                <RPrasad2@...> wrote:
                >
                > Hi Luke,
                >
                > Yes the example page works perfectly exactly I want my datatable to
                > work, but my code doesnot seem to behave that way...
                >
                >
                >
                > This is my piece of code...
                >
                >
                >
                > var myDataSource = new
                > DataSource("/kcm/ViewCatalog/CatalogViewGetCatalogLineItemsForEdit.do?")
                > ;
                >
                >
                >
                > myDataSource.responseType = DataSource.TYPE_JSON;
                >
                > myDataSource.responseSchema = {
                >
                > resultsList: "records",
                >
                > fields: [ "id","editStatus",
                >
                > <c:forEach var="element1"
                > items="${catalogLineItemHeaders}" varStatus="status">
                >
                > <c:choose>
                >
                > <c:when test = "${status.index <
                > (fn:length(catalogLineItemHeaders)-1)}">"attribute<c:out
                > value="${element1.columnNumber}"/>",</c:when>
                >
                >
                >
                > <c:otherwise>"attribute<c:out
                > value="${element1.columnNumber}"/>"</c:otherwise>
                >
                > </c:choose>
                >
                >
                >
                > </c:forEach>
                >
                > ],
                >
                >
                >
                > metaFields : {
                >
                > totalRecords: "totalRecords" // The totalRecords
                > meta field is
                >
                >
                > // a "magic" meta, and will be passed
                >
                >
                > // to the Paginator.
                >
                > }
                >
                > };
                >
                >
                >
                > YAHOO.util.Event.addListener("addrow","click",function() {
                >
                >
                >
                > var recoor =
                > {"id":"","attribute1":"","attribute2":"","attribute3":"","attribute4":""
                > ,"attribute5":"","attribute6":"","attribute7":"","attribute8":"","attrib
                > ute9":"","attribute10":"","attribute11":"","attribute12":"","attribute13
                > ":"","attribute14":"","attribute15":"","attribute16":"","attribute17":""
                > ,"attribute18":"","attribute19":"","attribute20":"","attribute21":"","at
                > tribute22":"","attribute23":"","attribute24":"","attribute25":"","attrib
                > ute26":"","attribute27":"","attribute28":"","attribute29":"","attribute3
                > 0":"","attribute31":"","attribute32":"","attribute33":"","attribute34":"
                > ","attribute35":"","attribute36":"","attribute37":"","attribute38":"","a
                > ttribute39":"","attribute40":"","attribute41":"","attribute42":"","attri
                > bute43":"","attribute44":"","attribute45":"","attribute46":"","attribute
                > 47":"","attribute48":"","attribute49":"","attribute50":"","attribute51":
                > "","attribute52":"","attribute53":"","attribute54":"","attribute55":"","
                > attribute56":""};
                >
                >
                >
                > myDataTable.addRow(recoor);
                >
                >
                >
                >
                >
                >
                >
                > },this,true);
                >
                >
                >
                >
                >
                >
                >
                > myDataTable.subscribe('rowAddEvent',function () {
                >
                > this.setPage(this.getTotalPages());
                >
                > },myPaginator,true);
                >
                >
                >
                > Clicking on addrow adds row but doesnot show it on UI the first time,
                > also wen the row is added in next page wrt current page, pagination
                > stops working, and we cannot goto next page where row is added...please
                > help...
                >
                >
                >
                >
                >
                >
                >
                > ________________________________
                >
                > From: ydn-javascript@yahoogroups.com
                > [mailto:ydn-javascript@yahoogroups.com] On Behalf Of y_lsmith
                > Sent: Monday, June 02, 2008 8:18 PM
                > To: ydn-javascript@yahoogroups.com
                > Subject: [ydn-javascript] Re: Issue with addRow() and pagination
                >
                >
                >
                > --- In ydn-javascript@yahoogroups.com
                > <mailto:ydn-javascript%40yahoogroups.com> , "rashmeep2000"
                > <RPrasad2@>
                > wrote:
                > >
                > > Hi luke,
                > > will this work only with 2.5.2?...coz ur example is for 2.5.2
                > > version...also do we need yahoo-dom-event.js for this feature?...coz
                > > i am not able to find it in 2.5.1 which i am using...
                > >
                > > the problem i am facing is...the first time i click on addrow, it
                > > doesnot add row, but takes me to that page..also after the page has
                > > reached its max number of pages, it creates subsequest pages, but
                > > pagination does not work after that....is this prob bcoz i have
                > > combned inline edit also....not sure..please clarify...
                > >
                >
                > It will work for 2.5.1. yahoo-dom-event.js is a compressed rollup of
                > yahoo.js, dom.js, and event.js.
                >
                > Can you provide a link to a page that reproduces the behavior? I
                > believe the example page I provided behaves as you expect in regards
                > to pagination and adding rows. Perhaps I'm not understanding what you
                > want the DataTable to do.
                >
                > Luke
                >
              • Rashmi Y. Prasad
                Hi Luke, I tried hard figuring out what could be aproblem...but not able to figure out since its exactly wat I am doing...I am attaching my jsp code which I
                Message 7 of 13 , Jun 3, 2008
                • 0 Attachment

                  Hi Luke,

                   

                  I tried hard figuring out what could be  aproblem…but not able to figure out since its exactly wat I am doing…I am attaching my jsp code which I am testing with..please let me know if you time to look at it…this will be of great help…thanks.

                   


                  From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of y_lsmith
                  Sent: Tuesday, June 03, 2008 12:02 AM
                  To: ydn-javascript@yahoogroups.com
                  Subject: [ydn-javascript] Re: Issue with addRow() and pagination

                   

                  I don't see your DataTable instantiation code. Have you tried
                  stepping through the code in FireBug?

                  If the example page works, then investigate the differences, or try
                  reducing your page until it either works, or looks like the example.

                  --- In ydn-javascript@ yahoogroups. com, " Rashmi Y. Prasad "
                  <RPrasad2@.. .> wrote:

                  >
                  > Hi Luke,
                  >
                  > Yes the example page works perfectly exactly I want my datatable to
                  > work, but my code doesnot seem to behave that way...
                  >
                  >
                  >
                  > This is my piece of code...
                  >
                  >
                  >
                  > var myDataSource = new
                  > DataSource(" /kcm/ViewCatalog /CatalogViewGetC atalogLineItemsF orEdit.do? ")
                  > ;
                  >
                  >
                  >
                  > myDataSource. responseType = DataSource.TYPE_ JSON;
                  >
                  > myDataSource. responseSchema = {
                  >
                  > resultsList: "records",
                  >
                  > fields: [ "id","editStatus" ,
                  >
                  > <c:forEach var="element1"
                  > items="${catalogLin eItemHeaders} "
                  varStatus="status" >
                  >
                  > <c:choose>
                  >
                  > <c:when test = "${status.index <
                  > (fn:length(catalogL ineItemHeaders) -1)}">"attribute <c:out
                  > value="${element1. columnNumber} "/>",</c: when>
                  >
                  >
                  >
                  > <c:otherwise> "attribute< c:out
                  > value="${element1. columnNumber} "/>"</c:otherwis e>
                  >
                  > </c:choose>
                  >
                  >
                  >
                  > </c:forEach>
                  >
                  > ],
                  >
                  >
                  >
                  > metaFields : {
                  >
                  > totalRecords: "totalRecords" // The totalRecords
                  > meta field is
                  >
                  >
                  > // a "magic" meta, and will be passed
                  >
                  >
                  > // to the Paginator.
                  >
                  > }
                  >
                  > };
                  >
                  >
                  >
                  > YAHOO.util.Event. addListener( "addrow", "click",function ()
                  {
                  >
                  >
                  >
                  > var recoor =
                  > {"id":"","attribute 1":"","attribute 2":"","attribute 3":"","attribute 4":""
                  > ,"attribute5" :"","attribute6" :"","attribute7" :"","attribute8" :"","attrib
                  > ute9":"","attribute 10":"","attribut e11":""," attribute12" :"","attribute13
                  > ":"","attribute14" :"","attribute15 ":"","attribute1 6":"","attribute 17":""
                  > ,"attribute18" :"","attribute19 ":"","attribute2 0":"","attribute 21":"","at
                  > tribute22":" ","attribute23" :"","attribute24 ":"","attribute2 5":"","attrib
                  > ute26":"","attribut e27":""," attribute28" :"","attribute29 ":"","attribute3
                  > 0":"","attribute31" :"","attribute32 ":"","attribute3 3":"","attribute 34":"
                  > ","attribute35" :"","attribute36 ":"","attribute3 7":"","attribute 38":"","a
                  > ttribute39": "","attribute40" :"","attribute41 ":"","attribute4 2":"","attri
                  > bute43":""," attribute44" :"","attribute45 ":"","attribute4 6":"","attribute
                  > 47":"","attribute48 ":"","attribute4 9":"","attribute 50":"","attribut e51":
                  > "","attribute52" :"","attribute53 ":"","attribute5 4":"","attribute 55":"","
                  > attribute56" :""};
                  >
                  >
                  >
                  > myDataTable. addRow(recoor) ;
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  > },this,true) ;
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  > myDataTable. subscribe( 'rowAddEvent' ,function () {
                  >
                  > this.setPage( this.getTotalPag es());
                  >
                  > },myPaginator, true);
                  >
                  >
                  >
                  > Clicking on addrow adds row but doesnot show it on UI the first time,
                  > also wen the row is added in next page wrt current page, pagination
                  > stops working, and we cannot goto next page where row is added...please
                  > help...
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  > ____________ _________ _________ __
                  >
                  > From: ydn-javascript@ yahoogroups. com
                  > [mailto:ydn-javascript@ yahoogroups. com]
                  On Behalf Of y_lsmith
                  > Sent: Monday, June 02, 2008 8:18 PM
                  > To: ydn-javascript@ yahoogroups. com
                  > Subject: [ydn-javascript] Re: Issue with addRow() and pagination
                  >
                  >
                  >
                  > --- In ydn-javascript@ yahoogroups. com
                  > <mailto:ydn- javascript% 40yahoogroups. com> ,
                  "rashmeep2000"
                  > <RPrasad2@>
                  > wrote:
                  > >
                  > > Hi luke,
                  > > will this work only with 2.5.2?...coz
                  w:st="on">ur example is for 2.5.2
                  > > version...also do we need yahoo-dom-event. js for this
                  feature?...coz
                  > > i am not able to find it in 2.5.1 which i am using...
                  > >
                  > > the problem i am facing is...the first time i click on addrow, it
                  > > doesnot add row, but takes me to that page..also after the page has
                  > > reached its max number of pages, it creates subsequest pages, but
                  > > pagination does not work after that....is this prob bcoz i have
                  > > combned inline edit also....not sure..please clarify...
                  > >
                  >
                  > It will work for 2.5.1. yahoo-dom-event. js is a compressed rollup of
                  > yahoo.js, dom.js, and event.js.
                  >
                  > Can you provide a link to a page that reproduces the behavior? I
                  > believe the example page I provided behaves as you expect in regards
                  > to pagination and adding rows. Perhaps I'm not understanding what you
                  > want the DataTable to do.
                  >
                  > Luke
                  >

                • y_lsmith
                  You are including yahoo-dom-event.js after other YUI libs. It should be loaded only once, before all other YUI libs. It is a rollup of yahoo-min.js,
                  Message 8 of 13 , Jun 4, 2008
                  • 0 Attachment
                    You are including yahoo-dom-event.js after other YUI libs. It should
                    be loaded only once, before all other YUI libs. It is a rollup of
                    yahoo-min.js, dom-min.js, and event-min.js, so you don't need to
                    include those separately.

                    You should declare a DOCTYPE for the page.

                    You should not change the prototype of Array. In your case, you are
                    recreating Array's native splice method.

                    You should avoid polluting the global namespace. See Doug Crockfords
                    videos on "The JavaScript Programming Language" at
                    http://developer.yahoo.com/yui/theater/

                    Your markup has many errors. For example, table tags in the head and
                    attempting to wrap the body element in a form.

                    I would recommend first validating the markup (http://www.w3.org has
                    tools for this), then converting from -min.js files to their -debug.js
                    counterparts and stepping through the interactions in FireBug.

                    Also, when providing code files/snippets, please spend some time
                    correctly formatting and indenting them for readability. People are
                    more likely to try to help if they don't have to work before even
                    reading the code. And it is not uncommon to find the error while
                    cleaning up indenting and such.


                    Luke

                    --- In ydn-javascript@yahoogroups.com, "Rashmi Y. Prasad"
                    <RPrasad2@...> wrote:
                    >
                    > Hi Luke,
                    >
                    >
                    >
                    > I tried hard figuring out what could be aproblem...but not able to
                    > figure out since its exactly wat I am doing...I am attaching my jsp code
                    > which I am testing with..please let me know if you time to look at
                    > it...this will be of great help...thanks.
                    >
                    >
                    >
                  Your message has been successfully submitted and would be delivered to recipients shortly.