FileExplorer onRowSelect resetsToolbar/GridContextMenu after 2012 Q1 update

2 posts, 0 answers
  1. Jed
    Jed avatar
    16 posts
    Member since:
    Apr 2009

    Posted 01 Mar 2012 Link to this post

    Hello,

       Based on each high level directory in FileExplorer I have a set of permissions specific to the path that I set. Based on these permissions I either show or hide the related toolbar icons or gridContextMenu option. After the 2012 Q1 update, if I select any item other than a directory in the grid section, the open and copy options are the only options enabled, all others are disabled. Could this be related to the new cell/column selection feature?

    Here is a portion of the code I use for the onClientFolderChange:

     

    function OnClientFolderChange(fileExplorer, args) {
                //var loadingPanel = fileExplorer.get_ajaxLoadingPanel();
                var treeview = fileExplorer.get_tree();
                var selectedNode = treeview.get_selectedNode();
                var dirCurrent = fileExplorer.get_currentDirectory();
                var toolbar = fileExplorer.get_toolbar();
                //toolbar.get_element().style.display = "none";
                var GridContextMenu = fileExplorer.get_gridContextMenu();
                var grid = fileExplorer.get_grid();
                var windowManager = fileExplorer.get_windowManager();
                var dir = selectedNode.get_text();
                var nodeParent = selectedNode.get_parent();
                if (nodeParent != null) {
                    var getNodeLevel = selectedNode.get_level();
                    var thisNode = selectedNode;
                    while (getNodeLevel != 0) {
                        if (getNodeLevel != 0) {
                            var parentDir = thisNode.get_parent();
                            dir = parentDir.get_text();
                            getNodeLevel = parentDir.get_level();
                            thisNode = parentDir;
                        }
                    }
                    // set permissions
                    // createDir
                    PageMethods.getPermission(dir, "createDir", function(response) {
                        //alert("dir: " + dir + " createDir response: " + response);
                        toolbar.trackChanges();
                        GridContextMenu.trackChanges();
                        var tbCreateDir = toolbar.findItemByValue("NewFolder");
                        var gcmCreateDir = GridContextMenu.findItemByValue("NewFolder");
                        if (response == "False") {
                            if (tbCreateDir != null) {
                                tbCreateDir.hide(0);
                            }
                            if (gcmCreateDir != null) {
                                gcmCreateDir.hide(0);
                            }
                        }
                        else if (response == "True") {
                            if (tbCreateDir != null) {
                                tbCreateDir.show();
                            }
                            if (gcmCreateDir != null) {
                                gcmCreateDir.show();
                            }
                        }
                        toolbar.commitChanges();
                        GridContextMenu.commitChanges();
                    });
                    // delete
                    PageMethods.getPermission(dir, "delete", function(response) {
                        toolbar.trackChanges();
                        GridContextMenu.trackChanges();
                        var tbDelete = toolbar.findItemByValue("Delete");
                        var gcmDelete = GridContextMenu.findItemByValue("Delete");
                        if (response == "False") {
                            if (tbDelete != null) {
                                tbDelete.hide(0);
                            }
                            if (gcmDelete != null) {
                                gcmDelete.hide(0);
                            }
                        }
                        else if (response == "True") {
                            if (tbDelete != null) {
                                tbDelete.show();
                            }
                            if (gcmDelete != null) {
                                gcmDelete.show();
                            }
                        }
                        toolbar.commitChanges();
                        GridContextMenu.commitChanges();
                    });

    Thanks!

    Jed
  2. Jed
    Jed avatar
    16 posts
    Member since:
    Apr 2009

    Posted 07 Mar 2012 Link to this post

    FYI...the post "FileExplorer stops working after 2012 Q1 update" contained the fix for this issue.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top