0

FocusCell after Grid PageChanged

Hi All ,


I have a picture grid ( 4 cloumns , 1 row , Horizontal orientation , attached to Pager) in a FullScreen View. There is a button on each sides of the grid , which are the 'Next ' and 'Previous ' buttons. On the 'Next ' button right navigation the focus will move from first cell to the next cell of the grid. When it navigate right from the 4th cell the pager will fetch the next page and populate the grid.But on the 'Next' navigation the focus will be on the last cell of the page , instead of first cell .Again if I right navigate the pager will fetch the next page and show.

In case of 'Previous' button left navigation the focus is on first cell .But expected is the last cell.

Can any of you please tell me how to solve this.

Thanks
Divya

by
2 Replies
  • To be more clear .
    My next Button on Navigate function is :


    CODE
    onNavigate: function(event) {
    switch(event.payload.direction){
    case 'right':
    event.preventDefault();
    this.owner.controls.grid.element.focus();
    break;
    case 'left':
    event.preventDefault();
    this.owner.controls.prevbutton.element.focus();
    break;
    }
    },


    And the fetch method is :


    CODE
    fetchFunction: function(fetchParams) {
    var page = fetchParams.page;
    var itemsPerPage = fetchParams.per_page;
    log("Inside fetchFunction Per PAge :" + itemsPerPage);
    var u = new URL();
    u.location = api.getMovieListURL(this.persist.tagId,itemsPerPage,page+1);
    u.fetchAsync(function(u) {
    if ( u.response == 200 ) {
    var result=responseHandler.getMovieList(u.result);
    KONtx.messages.store('details-r-here',result);
    var totalDatasetSize=currentAppData.get('totMovies');
    my_pager.onGotPage(fetchParams, result,totalDatasetSize);
    }
    });

    },




    Please help!
    Divya.
    0
  • If I understand the issue/desire, that functionality is built into the grid+pager functionality already and you are suppressing it with your design.

    Why would you ask the user to hit an additional "enter" on the next/rev buttons to load the page instead of just loading it when the user navigates right/left on the grid end cells as built in?
    0
  • Thank you for the reply.

    The buttons are the projects requirement.And I am using the 'on Navigate' event , not the 'onSelect' .
    Anyway I solved the issue by using grid's updateState on each pageDone.

    CODE
             pageDone:function(){  			 
    this.controls.grid._updateState({
    focusCoordinates: {
    row: 0,
    column: 0
    }
    });
    this.controls.grid.focus();
    },



    Thanks
    Divya.
    0
  • I would do a complete check on this. We have seen some issues with the focus in grids that it will work the first few times and then stop for some unknown reason... We have not been able to get to the bottom of it.
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets