Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Nov 2008
    Location
    Vienna - Austria
    Posts
    870
    Vote Rating
    1
    micgala is on a distinguished road

      0  

    Default [CLOSED] Record setDirty method not working

    [CLOSED] Record setDirty method not working


    Hi.

    I am trying to use the setDirty method to mark a cell dirty in the grid, but it is not working.
    It should be marked dirty after clicking the Change button.

    I am using FF. 3.5.7 on Mac.

    This is a test EntryPoint:

    PHP Code:
    public class StartupEntryPoint implements EntryPoint {
        
        private 
    int counter 0;
        
        public 
    void onModuleLoad() {
            
    Window window = new Window();
            
    window.setSize(400400);
            
    window.setLayout(new FitLayout());
            
            
    ColumnConfig nameConfig = new ColumnConfig("name""Name"100);
            
            final 
    ListStore<BaseModelstore = new ListStore<BaseModel>();
            final 
    BaseModel model = new BaseModel();
            
    model.set("name""Test");
            
    store.add(model);
            
            
    Grid<BaseModelgrid = new Grid<BaseModel>(store, new ColumnModel(Arrays.asList(nameConfig)));
            
            
    window.add(grid);
            
            
    Button change = new Button("Change");
            
    change.addSelectionListener(new SelectionListener<ButtonEvent>() {
                @
    Override
                
    public void componentSelected(ButtonEvent ce) {
                    
    model.set("name""Test" counter++);
                    
    store.getRecord(model).setDirty(true);
                    
    store.update(model);    
                }
            });
            
            
    window.addButton(change);
            
            
    window.show();
        }
        
        


  2. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    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


    The hole row is marked as dirty. There gets a cssclass assigned to it. There is just no visual indication.

    You cannot use setDirty to mark a single cell as dirty. To do that, you will need to mark a SINGLE entry as dirty. You can do that wirh record.set("x",x);

    Marking this as closed.

  3. #3
    Sencha User
    Join Date
    Nov 2008
    Location
    Vienna - Austria
    Posts
    870
    Vote Rating
    1
    micgala is on a distinguished road

      0  

    Default


    Thanks for the clarification.

    Maybe a helper method in the gridView for marking the record as dirty will be helpful.

    Regards,
    Michel.

Thread Participants: 1