使用JScript检索crm2011子网格中的行 [英] Retrieve rows in crm2011 subgrid with JScript
本文介绍了使用JScript检索crm2011子网格中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
作为一名JScript新手,我在MS CRM 2011中遇到子网格问题。
As an JScript newbie, I have a problem with a subgrid in MS CRM 2011.
我有一个带有子网格的表单,在该表单的OnSave中,我想要遍历子网格中的所有行。
I have a form with a subgrid and in OnSave of that form, I want to loop over all the rows in the subgrid.
如何使用JScript执行此操作?或者是否可能采用另一种方式,即插件?
How can I do this with JScript ? Or is it possible another way, ex plugin ?
Thx
推荐答案
以下是保存表格时可以执行的示例代码
Here is the sample code which you can do on save of the form
var gridControl = document.getElementById('grdrelatedcontacts').control;
for (var intRowNumber = 0; intRowNumber < gridControl.getRecordsFromInnerGrid().length; intRowNumber++)
for (var intCellNumber = 0; intCellNumber < gridControl.getRecordsFromInnerGrid()[intRowNumber][3].cells.length; intCellNumber++)
alert(gridControl.getRecordsFromInnerGrid()[intRowNumber][3].cells[intCellNumber].outerText);
这篇关于使用JScript检索crm2011子网格中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文