网格行在自定义选项卡上消失

时间:2016-10-31 20:23:33

标签: acumatica

在Project Task屏幕上,我添加了一个带有网格的新标签。

我创建了一个自定义表,其中包含一个projectid和一个taskid,我用它来过滤我的PXSelect与图扩展。

当我切换到标签时,行显示正确,然后一秒后它们消失了?它像Current.TaskId和Current.ProjectId松散那里的值或什么。请帮忙

以下是我如何设置

我的图表扩展

    public class ProjectTaskEntryExt : PXGraphExtension<ProjectTaskEntry>
{

    public PXSelect<UsrMAXXTaskEmployees,
        Where<UsrMAXXTaskEmployees.projectID, Equal<Current<PMTask.projectID>>,
            And<UsrMAXXTaskEmployees.taskID, Equal<Current<PMTask.taskID>>>>> BudgetEmployees;





    #region Event Handlers

    protected void UsrMAXXTaskEmployees_RowInserting(PXCache cache, PXRowInsertingEventArgs e, PXRowInserting InvokeBaseHandler)
    {
        if (InvokeBaseHandler != null)
            InvokeBaseHandler(cache, e);
        var row = (UsrMAXXTaskEmployees)e.Row;

        if (row != null)
        {
            row.ProjectID = Base.Task.Current.ProjectID;
            row.TaskID = Base.Task.Current.TaskID;

        }
    }

    public override void Initialize()
    {
        base.Initialize();

    }


    #endregion
}

这是表格的自定义dac

    public class UsrMAXXTaskEmployees : IBqlTable
{

    #region Selected
    public abstract class selected : IBqlField
    { }
    [PXBool]
    [PXUIField(DisplayName = "Selected")]
    public virtual bool? Selected { get; set; }
    #endregion

    #region ID
    public abstract class iD : PX.Data.IBqlField
    {
    }
    protected int? _ID;
    [PXDBIdentity(IsKey = true)]
    [PXUIField(Enabled = false)]
    public virtual int? ID
    {
        get
        {
            return this._ID;
        }
        set
        {
            this._ID = value;
        }
    }
    #endregion

    #region EmployeeID
    public abstract class employeeId : PX.Data.IBqlField
    {
    }
    protected String _EmployeeId;
    [PXDBString()]
    [PXUIField(DisplayName = "Employee")]
    [PXSelector(
        typeof(Search<PX.Objects.EP.EPEmployee.acctCD>),
        typeof(PX.Objects.EP.EPEmployee.acctCD),
        typeof(PX.Objects.EP.EPEmployee.acctName),
        DescriptionField = typeof(PX.Objects.EP.EPEmployee.acctName))]
    public virtual String EmployeeId
    {
        get
        {
            return this._EmployeeId;
        }
        set
        {
            this._EmployeeId = value;
        }
    }
    #endregion

    #region StartDate
    public abstract class startDate : PX.Data.IBqlField
    {
    }
    protected DateTime? _StartDate;
    [PXDBDate()]
    [PXDefault(typeof(AccessInfo.businessDate))]
    [PXUIField(DisplayName = "Start Date")]
    public virtual DateTime? StartDate
    {
        get
        {
            return this._StartDate;
        }
        set
        {
            this._StartDate = value;
        }
    }
    #endregion

    #region EndDate
    public abstract class endDate : PX.Data.IBqlField
    {
    }
    protected DateTime? _EndDate;
    [PXDBDate()]
    [PXUIField(DisplayName = "End Date")]
    public virtual DateTime? EndDate
    {
        get
        {
            return this._EndDate;
        }
        set
        {
            this._EndDate = value;
        }
    }
    #endregion

    #region ProjectID
    public abstract class projectID : PX.Data.IBqlField
    {
    }
    protected int? _ProjectID;
    [PXDBInt()]
    [PXDBDefault(typeof(PX.Objects.PM.PMProject.contractID))]
    [PXUIField(DisplayName = "Project")]
    public virtual int? ProjectID
    {
        get
        {
            return this._ProjectID;
        }
        set
        {
            this._ProjectID = value;
        }
    }
    #endregion

    #region TaskID
    public abstract class taskID : PX.Data.IBqlField
    {
    }
    protected int? _TaskID;
    [PXDBInt()]
    [PXDefault(0)]
    [PXUIField(DisplayName = "Task")]
    public virtual int? TaskID
    {
        get
        {
            return this._TaskID;
        }
        set
        {
            this._TaskID = value;
        }
    }
    #endregion

}

2 个答案:

答案 0 :(得分:1)

请检查您的网格是否启用了AutoSize,并且SkinID设置为DetailsInTab:

<px:PXGrid ID="gridNS" runat="server" SkinID="DetailsInTab" Width="100%" Height="150px" Caption="Mailings" AdjustPageSize="Auto" AllowPaging="True" DataSourceID="ds">
    <AutoSize Enabled="True" />
    <AutoCallBack Target="gridNR" Command="Refresh" />
    <Levels>
        <px:PXGridLevel DataMember=“NotificationSources" DataKeyNames="SourceID,SetupID">
            <Columns>
            ...
            </Columns>
        </px:PXGridLevel>
    </Levels>
</px:PXGrid>

答案 1 :(得分:0)

我将网格上的高度设置为100%,这是其他标签网格设置的。但是,一旦我将它设置为固定值(如300px),行就不会再出现了。