网格中的复选框控件未触发fieldupdated事件 [英] Checkbox control in a grid is not triggering fieldupdated event
本文介绍了网格中的复选框控件未触发fieldupdated事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在自定义网格上有一个选中的复选框,不会触发Fieldupdated事件。
I have a selected checkbox on a custom grid is not triggering the Fieldupdated event.
protected void MyTable_Selected_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e, PXFieldUpdated del)
{
del?.Invoke(cache, e);
var row = (MyTable)e.Row;
if(row.Selected == true )
{
//
}
}
以下是aspx页面中的代码
The following is the code in aspx page
<px:PXCheckBox ID="edSelected" runat="server" AlreadyLocalized="False" CommitChanges="True" DataField="Selected" Text="Selected">
</px:PXCheckBox>
该字段的DAC定义
#region Selected
public abstract class selected : IBqlField { }
/// <summary>
/// Used for selection on screens.
/// </summary>
[PXDBBool]
//[PXDefault(false)]
[PXUIField(DisplayName = "Selected")]
public virtual bool? Selected { get; set; }
#endregion
当我在网格中单击时,会出现一个红色标记,并且值未在服务器端提交。
When i click in the grid there is a red mark appears and the value is not committed on server side.
推荐答案
我遇到了同样的问题,并且我发现Grid上的属性 BatchUpdate被设置为 true,从而阻止了将更改提交给服务器。
I had the same problem and I figured out the property "BatchUpdate" was set to "true" on the Grid, which prevents the changes to be commited to the server.
一旦我将其设置为false,它就可以正常工作:
Once I set it to false it works fine :
这篇关于网格中的复选框控件未触发fieldupdated事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文