大家好,鄙人现在遇到一个问题。
我有一个UltraWebGrid 但是他是一个父子结构的。现在我想在子列表中加一列Checkbox,然后在Header中对这实现全不选中或者全部取消。实在搞不出来 ,请大家帮忙。
我在网上依葫芦画瓢,但是Header里Checkbox 根本看不到。不知道为何。
代码如下:
<igtbl:TemplatedColumn AllowUpdate="Yes" BaseColumnName="MyCheckConfirm" Key="MyCheckConfirm"
Type="CheckBox" Width="50px">
<HeaderTemplate>
<input id="cbSelectAll" name="cbSelectAll" type="checkbox" onclick="SelectAll(0)"/>
</HeaderTemplate>
<Header Caption="选中">
</Header>
</igtbl:TemplatedColumn>//JS 方法
var oGrid;
var cbSelectAll; //Selects all checkboxes in the grid
function SelectAll(colIndex)
{
var checked = cbSelectAll.checked;
for (i = 0; i < oGrid.Rows.length; i++)
{
oGrid.Rows.getCell(colIndex).setValue(checked);
}
} //Intialization function which sets the grid reference
function igrdInitializeLayout(object)
{
oGrid = igtbl_getGridById(object);
//need to set it here due to Infragistic’s handling of columns.
cbSelectAll = document.getElementById("cbSelectAll");
}//另外Grid客户端的方法我做了绑定:InitializeLayoutHandler="igrdInitializeLayout"
请问大家,问题出在哪?怎么解决?
我有一个UltraWebGrid 但是他是一个父子结构的。现在我想在子列表中加一列Checkbox,然后在Header中对这实现全不选中或者全部取消。实在搞不出来 ,请大家帮忙。
我在网上依葫芦画瓢,但是Header里Checkbox 根本看不到。不知道为何。
代码如下:
<igtbl:TemplatedColumn AllowUpdate="Yes" BaseColumnName="MyCheckConfirm" Key="MyCheckConfirm"
Type="CheckBox" Width="50px">
<HeaderTemplate>
<input id="cbSelectAll" name="cbSelectAll" type="checkbox" onclick="SelectAll(0)"/>
</HeaderTemplate>
<Header Caption="选中">
</Header>
</igtbl:TemplatedColumn>//JS 方法
var oGrid;
var cbSelectAll; //Selects all checkboxes in the grid
function SelectAll(colIndex)
{
var checked = cbSelectAll.checked;
for (i = 0; i < oGrid.Rows.length; i++)
{
oGrid.Rows.getCell(colIndex).setValue(checked);
}
} //Intialization function which sets the grid reference
function igrdInitializeLayout(object)
{
oGrid = igtbl_getGridById(object);
//need to set it here due to Infragistic’s handling of columns.
cbSelectAll = document.getElementById("cbSelectAll");
}//另外Grid客户端的方法我做了绑定:InitializeLayoutHandler="igrdInitializeLayout"
请问大家,问题出在哪?怎么解决?
var oChildRows = row.Rows;
for(j=0; j<oChildRows.length; j++) {
//oChildRow = oChildRows.getRow(j);
oChildRows.getRow(j).getCellFromKey("MyCheckConfirm").setValue(false);
}