出错图片如下:
出现的情况是在UltraWebGrid分页操作时,如果最后一页的行数小于UltraWebGrid设置的page数,而你分页前选择的行是最后一行没有的行,就会出现getRow为空的错误提示.(不知道大家明白我的意思没有-_-!)
因为这是Infragistics本身的bug问题(不知道新的06V3版本有没有这个情况,我是用05V3版本),所以只有修改对应的脚本了,对应的脚本:(那段出错function,在脚本文件ig_WebGrid_xml.js中)
1
function igtbl_requestSortComplete(gn)
2
{
3
var g=igtbl_getGridById(gn);
4
if(ig_csom.IsIE)
5
{
6
var node=g.XmlResp.selectSingleNode("form");
7
if(!node)
8
node=g.XmlResp;
9
node=node.selectSingleNode("xml/UltraWebGrid/Body/Rows");
10
var rows=g.Rows;
11
if(g.RowToQuery)
12
{
13
rows=g.RowToQuery.Rows;
14
for(var i=0;i<rows.Band.Index;i++)
15
node=node.selectSingleNode("Row/Rows")
16
}
17
rows.Node.parentNode.replaceChild(node,rows.Node);
18
rows.Node=node;
19
rows.SelectedNodes=node.selectNodes("Row");
20
var arIndex=-1,acColumn=null,acrIndex=-1,aRows=null;
21
if(g.oActiveRow && g.oActiveRow.OwnerCollection==rows)
22
arIndex=g.oActiveRow.getIndex();
23
if(g.oActiveRow && g.oActiveRow.Band.Index>=rows.Band.Index)
24
g.setActiveRow(null);
25
if(g.oActiveCell && g.oActiveCell.Row.OwnerCollection==rows)
26
{
27
acColumn=g.oActiveCell.Column;
28
acrIndex=g.oActiveCell.Row.getIndex();
29
}
30
if(g.oActiveCell && g.oActiveCell.Band.Index>=rows.Band.Index)
31
g.setActiveCell(null);
32
rows.dispose();
33
rows.length=rows.SelectedNodes.length;
34
rows.render();
35
if(arIndex!=-1)
36
if(rows.length > arIndex) //大家注意这里36行if(rows.length > arIndex)是我后添加的
37
rows.getRow(arIndex).activate(); //出错问题的地方,因为是直接读取上一页的行数,所以会出错,所以我在上面加了个判断.
38
if(acColumn)
39
{
40
if(acrIndex==-1)
41
{
42
if(rows.AddNewRow)
43
rows.AddNewRow.getCellByColumn(acColumn).activate();
44
}
45
else if(acrIndex<rows.length)
46
rows.getRow(acrIndex).getCellByColumn(acColumn).activate();
47
}
48
g.RowsRetrieved=rows.length;
49
if(rows.Band.Index==0)
50
{
51
if(g._scrElem)
52
{
53
igtbl_scrollTop(g._scrElem,0);
54
g.alignDivs();
55
}
56
else
57
igtbl_scrollTop(g.DivElement,0);
58
}
59
}
60
}
注:length和arIndex表示不一样的意思,rows.length为页面总的行数,而arIndex表示你选择的行号,而行号是从0开始.

2

3

4

5

6

7

8

9

10

11

12



13

14

15

16

17

18

19

20

21

22

23

24

25

26



27

28

29

30

31

32

33

34

35

36

37

38

39



40

41



42

43

44

45

46

47

48

49

50



51

52



53

54

55

56

57

58

59

60
