我想在 Infragistics WebDataGrid 的 javascript 函数中触发 CRUD 行更新操作
我有以下 Infragistics WedDataGrid (版本 2.9.2)和 JavaScript 函数。 WedDataGrid 中的第一列是模板化字段中的复选框,并且在复选框单击事件上调用 javascript 函数。
我想从已检查的行上的 javascript 函数内触发 CRUD 行更新操作。我需要使用什么电话?或者你能推荐另一种方法吗?我不想在行选择更改时触发它,只是在选中复选框时触发它。
js:
<script type="text/javascript">
function RowSelectedByCb(id) {
// trigger a row Update, but how? }
</script>
wdg:
<ig:WebDataGrid ID="igWdgComments" StyleSetName="Harvest" runat="server"
DataSourceID="odsSelectComments" AutoGenerateColumns="False"
DataKeyFields="DrugCommentPKey" AutoCRUD ="true" EnableViewState ="False">
<Columns>
<ig:TemplateDataField Key="cbSelect" Width="30px"><Header Text=" " />
<ItemTemplate>
<asp:CheckBox ID="cbSelect" runat="server" onclick="RowSelectedByCb(this)" />
</ItemTemplate>
</ig:TemplateDataField>
其余的专栏...
<Behaviors>
<ig:Activation Enabled="true" />
<ig:RowSelectors RowNumbering="True" />
<ig:Selection RowSelectType="Single" CellClickAction="Row" Enabled ="true">
<SelectionClientEvents CellSelectionChanged="CellChanged" />
</ig:Selection>
<ig:EditingCore >
<Behaviors>
<ig:CellEditing>
<CellEditingClientEvents EnteringEditMode="CellChanged" />
<EditModeActions EnableOnActive="True" MouseClick="Single" EnableOnKeyPress="True" />
</ig:CellEditing>
</Behaviors>
</ig:EditingCore>
</Behaviors>
其他东西...
I have the following Infragistics WedDataGrid (version 2.9.2), and JavaScript function. The first column in the WedDataGrid is a checkbox in a templated field and the javascript function is called on the checkbox click event.
I want to trigger the CRUD row Update operation from within the javascript function on the row that was checked. What is the call I need to use? Or can you recommend another way of doing this? I don't want to trigger it on rowselection changed, just when the checkbox is checked.
the js:
<script type="text/javascript">
function RowSelectedByCb(id) {
// trigger a row Update, but how? }
</script>
the wdg:
<ig:WebDataGrid ID="igWdgComments" StyleSetName="Harvest" runat="server"
DataSourceID="odsSelectComments" AutoGenerateColumns="False"
DataKeyFields="DrugCommentPKey" AutoCRUD ="true" EnableViewState ="False">
<Columns>
<ig:TemplateDataField Key="cbSelect" Width="30px"><Header Text=" " />
<ItemTemplate>
<asp:CheckBox ID="cbSelect" runat="server" onclick="RowSelectedByCb(this)" />
</ItemTemplate>
</ig:TemplateDataField>
Rest of the columns...
<Behaviors>
<ig:Activation Enabled="true" />
<ig:RowSelectors RowNumbering="True" />
<ig:Selection RowSelectType="Single" CellClickAction="Row" Enabled ="true">
<SelectionClientEvents CellSelectionChanged="CellChanged" />
</ig:Selection>
<ig:EditingCore >
<Behaviors>
<ig:CellEditing>
<CellEditingClientEvents EnteringEditMode="CellChanged" />
<EditModeActions EnableOnActive="True" MouseClick="Single" EnableOnKeyPress="True" />
</ig:CellEditing>
</Behaviors>
</ig:EditingCore>
</Behaviors>
Other stuff...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您希望网格自动更新其数据源,则需要将 EditingCore 行为添加到网格的行为集合中。然后你可以调用 commit 让它返回。
您将需要处理行更新服务器事件,以便立即发生回发。
If you would like the grid to automatically update its datasource, you'll need to add the EditingCore behavior to the grid's behaviors collection. Then you can call commit on that to have it go back.
You will want to handle the row updating server event in order for the postback to happen right away.