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

Re: [ydn-javascript] How i disable some cell in datatable

Expand Messages
  • Satyam
    I am not sure what is the question, but here are possible answers: If you don t want a whole column to be editable, simply don t assign an editor property to
    Message 1 of 2 , Aug 31, 2007
    • 0 Attachment
      I am not sure what is the question, but here are possible answers:

      If you don't want a whole column to be editable, simply don't assign an
      editor property to it in the column definitions.

      If you want a specific cell in a column that is editable, then one way to do
      it is to modify your listener to the cellClickEvent.

      Normally, you would have:

      myDataTable.subscribe('cellClickEvent',function ( ev) {
      myDataTable.onEventEditCell(ev);
      });

      Which will activate the cell editor on a cell click. There you can place
      code to prevent the editor from being activated. For example, lets assume
      you have some data in some column, the one to be edited or another one,
      which tells you whether it is editable or not. You can get the record
      object and access the value of any of its fields, check it against something
      and call the cell editor or not:

      myDataTable.subscribe('cellClickEvent',function ( ev) {
      var record = myDataTable.getRecord(YAHOO.util.Event.getTarget(ev));
      if (record.getData('somecolumn') != 'something') {
      myDataTable.onEventEditCell(ev);
      }
      });

      The field value might be on a column you are not even displaying. If it is
      named in the responseSchema.fields array, it will be available to you in the
      record object but if you don't name it in the column defs it won't be shown,
      but it will still be there.

      Satyam

      ----- Original Message -----
      From: "developergod" <developergod@...>
      To: <ydn-javascript@yahoogroups.com>
      Sent: Friday, August 31, 2007 10:27 AM
      Subject: [ydn-javascript] How i disable some cell in datatable


      >I create a editor datatable
      > but i want some cell to cannot edit not some column
      >
      > How can I do that ?
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      > --
      > No virus found in this incoming message.
      > Checked by AVG Free Edition.
      > Version: 7.5.484 / Virus Database: 269.13.0/980 - Release Date: 30/08/2007
      > 18:05
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.