由于js不能控制WebDatagrid的可编辑不可编辑,只能用前台控制。当checkbox行需要设置有时可选有时不可选,如何用js解决。
需要先后台设置可编辑.Behaviors.EditingCore.enabled=true;
然后前台设置:
WebDatagrid.get_columns().get_columnFromKey("行key值")._editableCheckbox = false;
进行前台设置。
<Columns> <ig:UnboundCheckBoxField Key="RemoveDocument" Header-Text="Rem" Width="30px"> </ig:UnboundCheckBoxField> <ig:BoundDataField DataFieldName="DocumentDescription" Key="DocumentDescription" Header-Text="Document Description" Width="403px" ></ig:BoundDataField> <ig:BoundDataField DataFieldName="LoanAppEnvelopeDocumentRecID" Key="LoanAppEnvelopeDocumentRecID" Hidden ="true"></ig:BoundDataField> </Columns> <Behaviors> <ig:EditingCore> <EditingClientEvents CellValueChanged="Grid_CellValueChanged" /> <Behaviors> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="RemoveDocument" ReadOnly="false" /> <ig:EditingColumnSetting ColumnKey="DocumentDescription" ReadOnly="true" /> </ColumnSettings> </ig:CellEditing> </Behaviors> </ig:EditingCore> <ig:Selection Enabled ="true"></ig:Selection> <ig:Activation Enabled="true"></ig:Activation> </Behaviors>
事件函数:
dgDocuments.get_columns().get_columnFromKey("HasSignerAssociatedWithDocument")._editableCheckbox = false;
时间: 2024-11-03 21:17:41