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

Re: [ydn-javascript] Re: DataTable click Row.

Expand Messages
  • Satyam
    As long as the field is listed in the DataSource responseSchema.fields array, it will be accessible. The column definitions determines what and how it is
    Message 1 of 4 , Jan 29, 2009
    • 0 Attachment
      As long as the field is listed in the DataSource responseSchema.fields
      array, it will be accessible. The column definitions determines what
      and how it is shown, not whether it is stored in the RecordSet or not.
      If you don't want to show a field, don't list it in the column defs, the
      values will still be there.

      Satyam


      jessicaraerose74 wrote:
      > Thanks that works.
      >
      > In order to get the "id", there must be a column definition like this
      > to access it.
      >
      > { key: "id", label: "ID", hidden: true } // Since I don't want to show
      > the ID to the user.
      >
      > ~Jessica
      >
      >
      > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
      >
      >> myDataTable.on("rowClickEvent", function(oArgs) {
      >> var target = oArgs.target;
      >> // You don't need this one:
      >> // var event = oArgs.event;
      >> var record = this.getRecord(target);
      >> var id = record.getData('id');
      >> // likewise for any other field within that same row, just
      >>
      > name it in getData
      >
      >> });
      >>
      >> Satyam
      >>
      >>
      >> jessicaraerose74 wrote:
      >>
      >>> Hi All,
      >>>
      >>> I modified the sample application
      >>>
      > yui_2.6.0/examples/datatable/dt_complex_clean.html and here are my
      >
      >>> changes
      >>>
      >>> areacodes: [
      >>> { id: "001", areacode: "201", state: "New Jersey" },
      >>> { id: "002", areacode: "202", state: "Washington, DC" },
      >>> { id: "003", areacode: "203", state: "Connecticut" },
      >>> { id: "004", areacode: "204", state: "Manitoba, Canada" },
      >>> { id: "005", areacode: "205", state: "Alabama" },
      >>> { id: "006", areacode: "206", state: "Washington" },
      >>> { id: "007", areacode: "207", state: "Maine" },
      >>> ]
      >>>
      >>> on click of the datatable I have this code
      >>>
      >>> myDataTable.on("rowClickEvent", function(oArgs) {
      >>> var target = oArgs.target;
      >>> var event = oArgs.event;
      >>> });
      >>>
      >>> In here how can I find out that a particular row was clicked and
      >>>
      > get
      >
      >>> the "id" from the JSON areacodes.
      >>>
      >>> Remember there is pagination and sorting so the "id" should always
      >>> correspond to what was clicked, even after sorting and paginating
      >>> "Washington, DC" should always return "002"
      >>>
      >>> Please help me.
      >>>
      >>> Thanks,
      >>> Jessica
      >>>
      >>>
      >>> ------------------------------------
      >>>
      >>> Yahoo! Groups Links
      >>>
      >>>
      >>>
      >>> ------------------------------------------------------------------
      >>>
      > ------
      >
      >>> No virus found in this incoming message.
      >>> Checked by AVG - www.avg.com
      >>> Version: 8.0.233 / Virus Database: 270.10.15/1922 - Release Date:
      >>>
      > 01/27/09 18:15:00
      >
      >>>
      >
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - www.avg.com
      > Version: 8.0.233 / Virus Database: 270.10.15/1923 - Release Date: 01/27/09 18:15:00
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.