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

32123RE: [ydn-javascript] Re: Issue with addRow() and pagination

Expand Messages
  • Rashmi Y. Prasad
    Jun 3, 2008

      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
      >

    • Show all 13 messages in this topic