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

Re: get DataSource field given DataTable value from same record

Expand Messages
  • Adrian Nye
    Well, that was easy, in the cell click handler it s just: var target = oArgs.target; var pk = this.getRecord(target);
    Message 1 of 3 , Feb 2, 2009
    • 0 Attachment
      Well, that was easy, in the cell click handler it's just:

      var target = oArgs.target;
      var pk = this.getRecord(target);

      --- In ydn-javascript@yahoogroups.com, "Adrian Nye" <adrian_nye@...>
      wrote:
      >
      >
      > My XHRDataSource contains a pk (primary key) field, but that value is
      > not in the column defs of the associated datatable. (I don't want to
      > show it.)
      >
      > Is there a way of getting that pk given a value in a cell in the same
      > row? If I could do this in the formatter function below, it would
      > allow me to avoid encoding and sending info to the server that it
      > already knows.
      >
      > var formatLink = function(elCell, oRecord, oColumn, oData) {
      >
      > //oData is complicated value in column 5.
      > //want to find out pk of same row that is in DataSource
      > //but not DataTable
      > };
      >
      > Or if this is not easy, then can I have a column in the DataTable that
      > is not shown at all?
      >
      > Thanks
      >
    • bretlevy
      Or just: var pk = oRecord.getData( pk ); ~~bret ... value is ... to ... same ... would ... DataSource ... that
      Message 2 of 3 , Feb 3, 2009
      • 0 Attachment
        Or just:

        var pk = oRecord.getData("pk");

        ~~bret



        --- In ydn-javascript@yahoogroups.com, "Adrian Nye" <adrian_nye@...>
        wrote:
        >
        >
        > Well, that was easy, in the cell click handler it's just:
        >
        > var target = oArgs.target;
        > var pk = this.getRecord(target);
        >
        > --- In ydn-javascript@yahoogroups.com, "Adrian Nye" <adrian_nye@>
        > wrote:
        > >
        > >
        > > My XHRDataSource contains a pk (primary key) field, but that
        value is
        > > not in the column defs of the associated datatable. (I don't want
        to
        > > show it.)
        > >
        > > Is there a way of getting that pk given a value in a cell in the
        same
        > > row? If I could do this in the formatter function below, it
        would
        > > allow me to avoid encoding and sending info to the server that it
        > > already knows.
        > >
        > > var formatLink = function(elCell, oRecord, oColumn, oData) {
        > >
        > > //oData is complicated value in column 5.
        > > //want to find out pk of same row that is in
        DataSource
        > > //but not DataTable
        > > };
        > >
        > > Or if this is not easy, then can I have a column in the DataTable
        that
        > > is not shown at all?
        > >
        > > Thanks
        > >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.