1

I am using Dojo EnhancedGrid and would like to set an item selected after calling XSP.partialRefreshPost or XSP.partialRefreshGet

 var store = dataGrid.store;
    index = grid.selection.selectedIndex;
    var item = dataGrid.getItem(index);
    var id = store.getValue(item, "@unid");
    var remoteMethod = myRPC.sortGridPosition(index + 'DOWN');
    remoteMethod.addCallback(function(response){
        // handle whatever came back from the server

        XSP.partialRefreshPost("#{id:gridDiv}",{
            onComplete: function () {
            grid.selection.setSelected(response, true);
            grid.selection.setSelected(parseInt(index), false);
        }   
        });
    }); 

but i keep geting the error cannot find focusView of undefined, how can i set index selected after XSP.partialRefreshPost?

3
  • Hmm, you are using response in your partialRefreshPost. Isn't this variable undefined? Commented Mar 2, 2016 at 8:12
  • the response is just the variable that hold the return value from remoteMethod
    – K.john
    Commented Mar 2, 2016 at 8:38
  • But you are using response in your onComplete of your partial refresh. This is a callback method, and response is undefined in this method (which is thrown in your error). Commented Mar 4, 2016 at 10:10

0

Browse other questions tagged or ask your own question.