1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    30
    Vote Rating
    0
    mvosantos is on a distinguished road

      0  

    Default .getSelectionModel().getSelection() is sending two values Extjs 4.0.7

    .getSelectionModel().getSelection() is sending two values Extjs 4.0.7


    Hey guys...
    I´m using Extjs 4.0.7

    I have a grid using the default selection, without checkbox or another selecionmodel.
    When I try to delete a record and my application server returns true, the record is deleted and I can keep working...great.
    But, When I try to delete a record and my application server returns false for any reason (constraints, rules) and I try to delete the same record again or another one, the store tries to send to my application server the record that I tried to delete before and the new one...in other words the store send me a json with two values (array). The first and the last one I tried to delete.
    Is there anything to reset the first selection or something else?

    I´ve heard about rejectChanges(), but it´s available only for Extjs 4.1

    There is my code:
    Code:
    var records = this.getGridList().getSelectionModel().getSelection();
    var store = this.getGridList().store;
    store.remove(records);
    store.sync();
    store.load();


  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,882
    Vote Rating
    439
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Is there any reason you cannot upgrade to 4.1? There were _many_ fixes from 4.07, not to mentioned the additional functions as you mentioned.

    The other alternative is to review the code in rejectChanges() in 4.1 and see if you can implement it into your code.

    Scott.

Thread Participants: 1