Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Disable single cell editing

    Hello,

    I have the following problem:
    I need to disable editing of some cells. For example disable only one, single cell in 20x20 grid, so I can't use neither whole column nor row disabling.

    Since in SmartGWT I can't add any handler to cell or row, I added EditorEnterHalnder to whole grid. Then I planned to retrieve from EditorEnterEvent event the clicked cell position and if it's my particular cell, then I can apply one of the following methods:

    Code:
    		myListGrid.cancelEditing();
    		myListGrid.deselectAllRecords();
    This partially works. It works when there is already some data in cell. Unfortunately when the cell is empty this method fails.

    My question is how to disable cell even if it's empty?
    Is there any better way to achieve 'disabled cell' effect?

    Thanks in advance.

    Kind regards,
    Pete

    #2
    Override canEditCell().

    Comment


      #3
      Thanks! That solved my problem.

      Comment


        #4
        regarding cell edit

        Hello,

        I have the following problem:
        I need to disable some cells in the listgrid based on row, column combination(row, column).

        For example i am having 3x4 editable grid i need to disable editing to the
        (2,3) cell. how can i do this?

        there is any example for how to override the canEditCell() method.

        Comment


          #5
          As was said earlier in the thread - override canEditCell() - or, if you always want columns 2 and 3 to be non-editable, use field.setCanEdit(false)

          Comment

          Working...
          X