1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Hyderabad
    Posts
    38
    Answers
    2
    Vote Rating
    0
    janardhan pasumarthi is on a distinguished road

      0  

    Default Answered: focus and focusNode in dataview are not worked as desired

    Answered: focus and focusNode in dataview are not worked as desired


    Hello All,

    I've a dataview, under which i'm loading data from store. When i click on add button, i'm adding new record to store, which is getting appended at last in the dataview, which is fine. But, what i want is, to focus the added record. When i add a new record, scrollbar should automatically scrolls down and focus the record.

    For that, i've tried with focus and focusNode methods. But, no change in the behavior. Please suggest me way to achieve focusing record.


    Thanks

  2. Hello All,

    I've decided to go with scrollBy of the panel instead of spending much time on focusNode as internally focusNode is also doing scrollBy. Here is how i got the solution.

    First, getting the node in the dataview based on record.

    Code:
    var node = dataview.getNode( record );
    then, getting the node element's region and storing bottom value of region.

    Code:
    var regionValue = Ext.get(node).getRegion().bottom;
    once i got the new item region, i'm scrolling the panel to the region bottom value.

    Code:
    panel.scrollBy(0,regionValue,true);

    Thanks

  3. #2
    Sencha User
    Join Date
    Mar 2012
    Location
    Hyderabad
    Posts
    38
    Answers
    2
    Vote Rating
    0
    janardhan pasumarthi is on a distinguished road

      0  

    Default Implemented focusing node using scrollBy as focusNode is not working

    Implemented focusing node using scrollBy as focusNode is not working


    Hello All,

    I've decided to go with scrollBy of the panel instead of spending much time on focusNode as internally focusNode is also doing scrollBy. Here is how i got the solution.

    First, getting the node in the dataview based on record.

    Code:
    var node = dataview.getNode( record );
    then, getting the node element's region and storing bottom value of region.

    Code:
    var regionValue = Ext.get(node).getRegion().bottom;
    once i got the new item region, i'm scrolling the panel to the region bottom value.

    Code:
    panel.scrollBy(0,regionValue,true);

    Thanks

  4. #3
    Sencha Premium Member
    Join Date
    Dec 2013
    Posts
    14
    Vote Rating
    0
    rahul.sood is on a distinguished road

      0  

    Default selecting record

    selecting record


    hi
    How did you do the record selection...i tried on callback after reload and it does not select