1. #1
    Sencha User
    Join Date
    Oct 2008
    Posts
    39
    Vote Rating
    0
    iBeb is on a distinguished road

      0  

    Default deselectRow(index) & getSelectionModel() index

    deselectRow(index) & getSelectionModel() index


    Hi there,

    I'm experiencing a issue with getSelectionModel() and deselectRow().
    I have a grid with a RowSelectionModel. There's one button to delete selected rows.
    But before to delete the row, I have to check is one field in record.data is not equal to a certain value. Regarding this, I allow or not to delete the row, and deselect the row if not allowed.

    PHP Code:
        ,delRoom:function(p){
            
    p.getSelectionModel().each(function(item,index){
                if(
    item.data.parent_id==1||item.data.r_room_id==1){
                    
    Ext.ux.Toast.msg(__('shared.popup.avertissement'),__('travel.popup.roomError'));
                    
    p.getSelectionModel().deselectRow(index);
                }
            },
    this);
            return 
    true;
        } 
    The thing is getSelectionModel().each() returns the index of the row inside the selection, and to deselect a row you need the index of the row inside the grid

    So as you can see, my function doesn't work, because I don't use the good index to deselect a row.
    I don't know how to make the two indexes match.
    Which method could I use from Ext.grid.GridPanel or Ext.grid.RowSelectionModel to make it work?

    Thanx in advance,

    _bertrand

  2. #2
    Ext User
    Join Date
    Oct 2008
    Posts
    41
    Vote Rating
    0
    Spring is on a distinguished road

      0  

    Default


    You can define the row index from store. In this case it will look like:


    Code:
     
    p.getSelectionModel().deselectRow(p.getStore().indexOf(item));

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi