protected void tlbMain_CallBack(object sender, PX.Web.UI.PXCallBackEventArgs e)
 {
     PX.SM.PortalMapMaint graph = ds.DataGraph as PX.SM.PortalMapMaint;
     graph.Persist();
     graph.Caches[typeof(PX.SM.PortalMap)].IsDirty = false;
     graph.Children.View.RequestRefresh();
 }
Ejemplo n.º 2
0
    /// <summary>
    /// The grid and tree toolbar callback event handler.
    /// </summary>
    protected void tbCommand_CallBack(object sender, PX.Web.UI.PXCallBackEventArgs e)
    {
        var tree = sp1.FindControl("tree") as PXTreeView;
        var grid = sp1.FindControl("grid") as PXGrid;

        PX.SM.FavoritesMaintenance fv = ds.DataGraph as PX.SM.FavoritesMaintenance;
        Guid selectedNode;

        if (PX.Common.GUID.TryParse(tree.SelectedValue, out selectedNode))
        {
            PXAdapter adapter = new PXAdapter(fv.Views[ds.PrimaryView]);
            adapter.SortColumns   = null;
            adapter.Descendings   = null;
            adapter.Parameters    = new object[] { selectedNode, grid.DataValues["NodeID"] };
            adapter.Searches      = null;
            adapter.Filters       = null;
            adapter.StartRow      = 0;
            adapter.MaximumRows   = grid.PageSize;
            adapter.TotalRequired = true;
            switch (e.Command.Name)
            {
            case "left":
                foreach (object r in fv.RowLeft.Press(adapter))
                {
                    break;
                }
                break;

            case "right":
                foreach (object r in fv.RowRight.Press(adapter))
                {
                    break;
                }
                break;

            case "up":
                foreach (object r in fv.RowUp.Press(adapter))
                {
                    break;
                }
                break;

            case "down":
                foreach (object r in fv.RowDown.Press(adapter))
                {
                    break;
                }
                break;
            }
            e.Result = "1";
        }
    }