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

inline datatable editing: supressing editor with cells of a certain value

Expand Messages
  • illiphilli
    Hey all, I ve got a datable with inline editing, and what I d like to do is disallow the editing of cells with a certain value. I m listening to all cells set
    Message 1 of 2 , Jul 1, 2009
    • 0 Attachment
      Hey all,

      I've got a datable with inline editing, and what I'd like to do is disallow the editing of cells with a certain value. I'm listening to all cells set up to use the editor with this function:

      myDataTable.subscribe("cellClickEvent",myDataTable.onEventShowCellEditor);

      What I need to figure out is:
      1) if a record comes in with say a value of 0, allow the record to be editable, otherwise, don't allow the editor to pop.

      2) If the record is 0, pop the editor, allow it to be changed (and submitted via asyncSubmitter), but after the change, disallow it to be edited again.

      I just need some tips inside the filter and async callbacks to get me going in the right direction.

      Thanks in advance,
      Phillip
    • illiphilli
      Managed to solve both issues at once with this little number: myDataTable.onEventShowCellEditor = function(oArgs) { if (this.getColumn(oArgs.target).getField()
      Message 2 of 2 , Jul 1, 2009
      • 0 Attachment
        Managed to solve both issues at once with this little number:

        myDataTable.onEventShowCellEditor = function(oArgs) {
        if (this.getColumn(oArgs.target).getField() != "shared" || this.getRecord(oArgs.target).getData().shared==0) {
        this.showCellEditor(oArgs.target);
        }
        }

        I'm overwriting the datatable's default onEventShowCellEditor func, popping a quick check to make sure we're in the right column, and that the value of the record in question isn't already set.

        Thanks for letting me put my thoughts out there!

        Phillip

        --- In ydn-javascript@yahoogroups.com, "illiphilli" <phillip@...> wrote:
        >
        > Hey all,
        >
        > I've got a datable with inline editing, and what I'd like to do is disallow the editing of cells with a certain value. I'm listening to all cells set up to use the editor with this function:
        >
        > myDataTable.subscribe("cellClickEvent",myDataTable.onEventShowCellEditor);
        >
        > What I need to figure out is:
        > 1) if a record comes in with say a value of 0, allow the record to be editable, otherwise, don't allow the editor to pop.
        >
        > 2) If the record is 0, pop the editor, allow it to be changed (and submitted via asyncSubmitter), but after the change, disallow it to be edited again.
        >
        > I just need some tips inside the filter and async callbacks to get me going in the right direction.
        >
        > Thanks in advance,
        > Phillip
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.