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

RE: [ydn-javascript] Not allowing to select a row in a datatable...

Expand Messages
  • Nagasamudram, Prasanna Kumar
    Thanks a lot satyam. The formatter was what I was looking for. This solved my purpose. Thanks Prasanna ________________________________ From:
    Message 1 of 3 , Oct 8, 2007
    • 0 Attachment

      Thanks a lot satyam.

       

      The formatter was what I was looking for.

       

      This solved my purpose.

       

      Thanks

      Prasanna

       


      From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of Satyam
      Sent: Friday, October 05, 2007 7:40 PM
      To: ydn-javascript@yahoogroups.com
      Subject: Re: [ydn-javascript] Not allowing to select a row in a datatable...

       

      To select a row, you would normally have this code somewhere:

       

      myDataTable. subscribe("rowClickEvent", myDataTable.onEventSelectRow) ;

       

      Instead of passing that event straight to the onEventSelectRow method, you would catch it and do what you want:

       

      myDataTable. subscribe("rowClickEvent", function(ev) {

          var record = this.getRecord( ev.target) ;

          if (record.getData( 'somefield' ) == 'something') {

              this.onEventSelectRow( ev);

          }

      });

       

      In this case I am making the row selection depending on the value of some field, otherwise nothing happens.

       

      As for blurring those rows that cannot be selected, I would define a CSS style that looks blurred and assign it to the rows not to be selected.  I would do that via the formatter column for the field that conditions the selectability. 

       

      formatter: function(elCell, oRecord, oColumn,oData) {

          if (oData != 'something') {  

              var row = this.getTrEl( elCell);

              YAHOO.util.Dom. addClass( row,'blurred' );

          }

          elCell.innerHTML = oData;

      };

       

      Satyam

       

      ----- Original Message -----

      Sent: Friday, October 05, 2007 2:24 PM

      Subject: [ydn-javascript] Not allowing to select a row in a datatable...

       

      Hi All

       

      I have a data table where on, cell click event I call selectrow.

       

      Is it possible that I can blur a row, I mean make a row not to handle any events ?

       

       

       

      Thanks

      Prasanna

      size=2 width="100%" align=center>

      No virus found in this incoming message.
      Checked by AVG Free Edition.
      Version: 7.5.488 / Virus Database: 269.14.1/1050 - Release Date: 04/10/2007 17:03

    Your message has been successfully submitted and would be delivered to recipients shortly.