mardi 25 novembre 2014

Go to node in proxy store

Hello together,

we are having a nestedlist with a store showing directories and files. In another panel this list can be synchronized, so the store may can be changed after the sync.


If we go back to the nested list we want to be at the same node as before the sync.


Here is the belonging code:



Code:



syncFinished: function()
{
var lastNode = this.fileFolderList.getLastNode();
var lastPathOfLastNode = null;
if (lastNode)
{
var data = lastNode.getData();
if (data) lastPathOfLastNode = data.path;
}


var fileStore = this.getFileStore();
if (fileStore)
{
this.fileFolderList.setStore(fileStore);
var store = this.fileFolderList.getStore();
if (lastPathOfLastNode)
{
var record = store.findRecord("path",lastPathOfLastNode);
this.fileFolderList.goToNode(record);
}
}
else console.log("FileStore couldn't be loaded");
},



This code worked till we changed our store to be a proxy store, which loads the store dynamically.

Since that the findRecord() doesn't work anymore. Is there someone who knows a solution for our problem?

Thank you very much :-)






Go to node in proxy store

Aucun commentaire:

Enregistrer un commentaire