1. #1
    Sencha User
    Join Date
    Aug 2009
    Vote Rating
    r4nd7263 is on a distinguished road


    Default Find and focus on a row in TreeGrid

    Find and focus on a row in TreeGrid

    Given a TreeModel, I want to focus on the row that represents the model in TreeGrid.

    Normally with regular Grid, I do

    int index = grid.getStore().indexOf(m);
    For TreeGrid, I changed to

    int index = grid.getTreeStore().indexOf(m);
    But indexOf returns the index in parent, not the index in grid so the focus is off.

    How do I get the row index in grid? Or how do I get view to focus on a model?

  2. #2
    Sencha User WesleyMoy's Avatar
    Join Date
    Oct 2009
    Redwood City, California
    Vote Rating
    WesleyMoy is on a distinguished road



    What you're trying to do would be most easily handled by getting the ListStore (not the TreeGridStore) from the TreeGrid and using that to find the index of your model object. You can get the ListStore by calling getStore on TreeGrid. This lets you determine exactly what the row index of the item is using indexOf. At this point, you can focus the appropriate row.

    The reason you should be using the ListStore is that this store represents the rows that will actually be displayed, in the order they would be shown. Any nodes that have been hidden because of filtering or collapsed parent nodes will correctly not take up any space. (These nodes themselves are not in the store and will have an index of -1.)

    There are a few things to keep in mind if you take this approach. First, the Grid must already have finished rendering. Second, any operation you may be responding to (like expanding, drag and drop, etc.) could result in a change in the index of the item you're interested in.

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