clipboardOperation = inOperation;
this.clipboardPath = directoryTree.getUserData(inSelectedDirectory, "path");
this.clipboardName = fileGrid.getUserData(inSelectedItem, "name");
var itemType = fileGrid.cells(inSelectedItem, 2).getValue();
if (itemType == "Directory") {
this.clipboardType = "directory";
} else {
this.clipboardType = "file";
}
} // End doCopyCut().
CHAPTER 6 n REMOTELY MANAGING YOUR FILES: DWR FILE MANAGER 303
First, we check to be sure both a directory in the tree and a file (or directory) in the grid is
selected, and we abort with an alert message if that??™s not the case. Then, we store which operation
is being performed as passed in via the inOperation parameter, as well as the tree node ID
of the selected directory and row ID of the selected file or directory in the grid. Finally, we get
the value of the third column (cell) in the grid (the cells are 0-based, so name is 0, size is 1, and
type is 2) and set the clipboardType according to that value. At this point, we are ready to paste
the copied/cut item when the user wants to.
doPaste() Method
The doPaste() method complements the doCopyCut() method, the ying to the other??™s yang, if
you will.
Pages:
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546