Results 1 to 2 of 2

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

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    30
    Vote Rating
    0
      0  

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

    Hey guys...
    Im 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?

    Ive heard about rejectChanges(), but its 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
    9,389
    Vote Rating
    498
      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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •