Skip to content

Instantly share code, notes, and snippets.

@genakim
Created November 30, 2017 07:23
Show Gist options
  • Save genakim/fefcd71b7b14b3d6c60f6bdfeb76f7db to your computer and use it in GitHub Desktop.
Save genakim/fefcd71b7b14b3d6c60f6bdfeb76f7db to your computer and use it in GitHub Desktop.
var me = this,
vm = me.getViewModel(),
rec = vm.get('rec'),
grid = me.lookup('grid');
var range = Ext.getStore('StructuresBase').getRange();
var structureStore = vm.getStore('Structures');
var root = me.getTree(range, rec);
structureStore.setRootNode(root);
if(rec){
var selection = structureStore.getNodeById(rec.getId());
grid.setSelection(selection);
setTimeout(function(){
var domSelection = grid.getView().getNode(selection);
domSelection.scrollIntoView(false);
console.log(domSelection);
}, 300);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment