Announcement

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

    Disable a single cell in a ListGrid

    Hallo

    I have a little question about the ListGrid. I have a ListGrid with a six ListGridFields. The type of five of them are boolean.

    Code:
    bestaetigenField.setType(ListGridFieldType.BOOLEAN);
    aenderungField.setType(ListGridFieldType.BOOLEAN);
    neuzugangField.setType(ListGridFieldType.BOOLEAN);
    spLoeField.setType(ListGridFieldType.BOOLEAN);
    lesenField.setType(ListGridFieldType.BOOLEAN);
    
    getGridAnzeige().setFields(new ListGridField[] {klasseField, lesenField, bestaetigenField, aenderungField, neuzugangField, spLoeField});
    If I put data in the Grid I would like to disable the second cell in the third row. How can I realise that? Thanks for any help I'll get.
    Last edited by Ceene; 28 Jun 2011, 02:19.

    #2
    You can write addCellClickHandler on ListGrid. Please find code below.
    Code:
    grid.addCellClickHandler(new CellClickHandler() {
    			
    			@Override
    			public void onCellClick(CellClickEvent event) {
    				SC.say(event.getRowNum()+" "+event.getColNum();
    			}
    });

    Comment


      #3
      Override canEditCell().

      Comment


        #4
        @ skaluva: Thanks, but I like to disable the cell if I fill the Grid with data. I search for a possibility to disable a single cell without a handler.

        @ davidj6: I tried it with ListGridRecord.setCanEdit(false) but than the whole column ist disabled but I like to disable a single cell.
        Last edited by Ceene; 30 Jun 2011, 01:32.

        Comment


          #5
          Can you give me an example for @Override canEditCell() ? I'm a beginner in GWT.
          Last edited by Ceene; 1 Jul 2011, 01:41.

          Comment


            #6
            Originally posted by davidj6
            Override canEditCell().
            Thanks that ist the solution.

            Comment

            Working...
            X