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

First record in a Recordset

Expand Messages
  • luis_olarte
    Hi, I m trying to get the first record of datasource, here is the code: var id = myDataTable.getRecordSet().getRecord(0)[ column1 ]; but i can t get it but
    Message 1 of 4 , Mar 30, 2007
    • 0 Attachment
      Hi, I'm trying to get the first record of datasource, here is the code:

      var id = myDataTable.getRecordSet().getRecord(0)["column1"];

      but i can't get it but only the first record, (index 0), if i get
      other record the 1,2, .... it works, for example:

      var id = myDataTable.getRecordSet().getRecord(1)["column1"];

      So i can't get the information of the first row, can you help me please?
    • Ted Husted
      This is a known issue that s been fixed for the next release. In the meantime, you can do this instead: var id = this._oRecordSet[0].id; HTH, Ted.
      Message 2 of 4 , Mar 30, 2007
      • 0 Attachment
        This is a known issue that's been fixed for the next release.

        In the meantime, you can do this instead:

        var id = this._oRecordSet[0].id;

        HTH, Ted.
        <http://husted.com/ted/blog/>

        --- In ydn-javascript@yahoogroups.com, "luis_olarte" <luis_olarte@...>
        wrote:
        >
        > Hi, I'm trying to get the first record of datasource, here is the code:
        >
        > var id = myDataTable.getRecordSet().getRecord(0)["column1"];
        >
        > but i can't get it but only the first record, (index 0), if i get
        > other record the 1,2, .... it works, for example:
        >
        > var id = myDataTable.getRecordSet().getRecord(1)["column1"];
        >
        > So i can't get the information of the first row, can you help me please?
        >
      • luis_olarte
        Hi Ted, Sorry i m new in yui, so I can t understand, could you explain this please. How do i use it in my exmaple: var id =
        Message 3 of 4 , Mar 30, 2007
        • 0 Attachment
          Hi Ted,

          Sorry i'm new in yui, so I can't understand, could you explain this
          please.

          How do i use it in my exmaple:

          var id = myDataTable._oRecordSet.getRecord(0).id

          This way it doesn't work.



          --- In ydn-javascript@yahoogroups.com, "Ted Husted" <groups@...> wrote:
          >
          > This is a known issue that's been fixed for the next release.
          >
          > In the meantime, you can do this instead:
          >
          > var id = this._oRecordSet[0].id;
          >
          > HTH, Ted.
          > <http://husted.com/ted/blog/>
          >
          > --- In ydn-javascript@yahoogroups.com, "luis_olarte" <luis_olarte@>
          > wrote:
          > >
          > > Hi, I'm trying to get the first record of datasource, here is the
          code:
          > >
          > > var id = myDataTable.getRecordSet().getRecord(0)["column1"];
          > >
          > > but i can't get it but only the first record, (index 0), if i get
          > > other record the 1,2, .... it works, for example:
          > >
          > > var id = myDataTable.getRecordSet().getRecord(1)["column1"];
          > >
          > > So i can't get the information of the first row, can you help me
          please?
          > >
          >
        • luis_olarte
          I found the solution is to cast to the response to a variable: var resp = myDataTable.getRecordSet().getRecords(); alert( Resp: + resp[0][ column1 ]);
          Message 4 of 4 , Mar 30, 2007
          • 0 Attachment
            I found the solution is to cast to the response to a variable:

            var resp = myDataTable.getRecordSet().getRecords();
            alert("Resp: " + resp[0]["column1"]);


            --- In ydn-javascript@yahoogroups.com, "luis_olarte" <luis_olarte@...>
            wrote:
            >
            > Hi Ted,
            >
            > Sorry i'm new in yui, so I can't understand, could you explain this
            > please.
            >
            > How do i use it in my exmaple:
            >
            > var id = myDataTable._oRecordSet.getRecord(0).id
            >
            > This way it doesn't work.
            >
            >
            >
            > --- In ydn-javascript@yahoogroups.com, "Ted Husted" <groups@> wrote:
            > >
            > > This is a known issue that's been fixed for the next release.
            > >
            > > In the meantime, you can do this instead:
            > >
            > > var id = this._oRecordSet[0].id;
            > >
            > > HTH, Ted.
            > > <http://husted.com/ted/blog/>
            > >
            > > --- In ydn-javascript@yahoogroups.com, "luis_olarte" <luis_olarte@>
            > > wrote:
            > > >
            > > > Hi, I'm trying to get the first record of datasource, here is the
            > code:
            > > >
            > > > var id = myDataTable.getRecordSet().getRecord(0)["column1"];
            > > >
            > > > but i can't get it but only the first record, (index 0), if i get
            > > > other record the 1,2, .... it works, for example:
            > > >
            > > > var id = myDataTable.getRecordSet().getRecord(1)["column1"];
            > > >
            > > > So i can't get the information of the first row, can you help me
            > please?
            > > >
            > >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.