View Full Version : Updating temp store from tree D&D

26 Oct 2010, 1:43 AM
I'm updating tree2 with items dropped from tree1.
After tree2 has a new node added, I'm trying to update a temp store to hold the values of the node dropped, so i can search through this store to upoad to server when the user has finished. The tree can be quite deep, and the user can use a filter to reload tree multiple times before actually saving any data back to the server, hence why I think it's a better idea to add the records to a temp store.

I'm only working with one item at the moment to get functionality to work.

Temp Store

var treeStdRecord = Ext.data.Record.create([
{name: 'id', mapping : 'id'}

var tmpStore = new Ext.data.JsonStore({
autoLoad : false,
storeId: 'tmpStore',
record : treeStdRecord
Tree Panel and Loader

var grpTreeLoader = new Tree.TreeLoader({
dataUrl: 'myUrl',
preloadChildren: grpTree,

var grpTreeRoot = new Ext.tree.AsyncTreeNode({
draggable: false,
id: 'src',
expanded: true,
loader: grpTreeLoader,
text: 'Groups'

var grpTree = new Tree.TreePanel({
margins: '0 0 0 5',
minSize: 175,
maxSize: 500,
id: 'grpTree',
split: true,
autoScroll: true,
animate: true,
enableDD: true,
border: false,
containerScroll: true,
rootVisible: false,
root : grpTreeRoot,
loader: grpTreeLoader,
ddGroup : 'treeDDGroup',
tbar:['Filter:', {
,onTriggerClick:function() {
keyup:{fn:function(field, e) {
if(Ext.EventObject.ESC == e.getKey()) {
else if(Ext.EventObject.ENTER == e.getKey()){
grpTreeLoader.baseParams.param = this.getValue()

I handle the Nodedrop and try to create a new record based on the temp store(adding node.id)
and to add to the store.

grpTree.on('nodedrop', function (e) {
var node = e.dropNode;
var newRec = new treeStdRecord(node.id);

When I get to tmpStore.add, I get an error in firefox, pointing me to ext-all,js, but I'm not sure what the error is as nothing is displayed in the console.

Is this possible.

26 Oct 2010, 6:16 AM
Apologies, it actually works as it is.