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

32017Re: Issue with addRow() and pagination

Expand Messages
  • y_lsmith
    Jun 2, 2008
      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
      >
    • Show all 13 messages in this topic