1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    55
    Vote Rating
    0
    DarekKay is on a distinguished road

      0  

    Default Unanswered: [CLOSED] Editing Grid - ready to use?

    Unanswered: [CLOSED] Editing Grid - ready to use?


    There were several issues regarding grid editing, so I waited for the beta release. Now I've tried to convert my GXT 2 application, but I've got the feeling this feature is not finished yet.

    First of all: you removed the EditorGrid and added GridInlineEditing. I assume, you had your reason for doing so. There is no getter for the GridInlineEditing, though. So there is no way to add an editing event from outside (untill I define my own getter). It looks like "we can't know, whether or not the Grid is editable, so we just don't provide a getter". We would know that, if we still got the EditorGrid.

    You also removed the ValidateEdit and AfterEdit events and added the following ones:
    - BeforeStartEditEvent
    - CancelEditEvent
    - CompleteEditEvent
    - StartEditEvent

    I miss the rollback functionality, I achieved with the ValidateEdit event. How exactly can I prevent a cell from getting updated with the new value? The only possible event seems to be the CompleteEditEvent. But it seems like it's the AfterEdit equivalent - a GridInlineEditing.cancelEditing() has no effect. Why is a validation event missing? A workaround would be to save the value on the StartEditEvent and rollback it manually after..

    Another issue: it's quite hard to get the current value. Assuming I want to get the currently typed text within the CompleteEditEvent, this looks like that:

    Code:
    @Override
    public void onCompleteEdit(CompleteEditEvent<HumanAttributeValueDTO> event)
    {
        String currentString = event.getSource().getEditor(valuesTable.getColumnModel().getColumn(event.getEditCell().getCol())).getValue().toString();
    }
    The old "be.getValue().toString()" seems to be a more clear solution imho.

    And how exactly can I force a cell editing? There is the GridInlineEditing.startEditing(GridCell) - but how can I get my desired cell (1,2)? Back in GXT 2 this was a simple EditorGrid.startEditing(1,2)..


    So either it's just the lack of documentation (which is understable in this phase) - or the new grid editing functionality is not designed very well.

  2. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    Answers
    60
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    It looks like "we can't know, whether or not the Grid is editable, so we just don't provide a getter". We would know that, if we still got the EditorGrid.
    The grid will not know if it can be editited or not. Only your code can know this. Using an EditorGrid in GXT 2 does not mean that it can be edited.


    We could probably add an BeforeCompleteEditEvent that you could cancel if validation fails. However, is this really required? This event would only be valid for row and inline editing. What happens in different places where you use a Record manually? Another approach would be to listen to the StoreRecordChangeEvent. You could even roll back the change directly


    And how exactly can I force a cell editing? There is the GridInlineEditing.startEditing(GridCell) - but how can I get my desired cell (1,2)? Back in GXT 2 this was a simple EditorGrid.startEditing(1,2)..
    startEditing is a public method and so can be called. GridCell is a public class and can be create. The example even shows how to start editing. It is the exact same API for rowediting and inline editing. I would not call it bad designed. You can switch, with a single line change, from row editing to inline editing.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    55
    Vote Rating
    0
    DarekKay is on a distinguished road

      0  

    Default


    So it really was only the lack of documentation: now I can achieve everything I wanted. Thanks a lot!

Thread Participants: 1