您的位置:首页 > 其它

WebDatagrid-左边的checkbox决定右边的文本是否进入编辑状态

2015-11-30 10:41 288 查看
Assuming you are using templates for the check box column and the checkbox is the only control in that template, something like the following can be used for your scenario.

确定你用的是templates 的checkbox行,并且该模板中只有checkbox一个空间。

Handle the EnteringEditMode event off of the CellEditing behavior.添加一个EnteringEditMode 事件

<ig:EditingCore>

<Behaviors>

<ig:CellEditing>

<CellEditingClientEventsEnteringEditMode="enteringEditMode" />

</ig:CellEditing>

</Behaviors>

</ig:EditingCore>


The event handler may look like this:事件函数如下:

function enteringEditMode(grid, eventArgs)

{

var cell = eventArgs.getCell();

if (cell.get_column().get_key() == "SecondColumn")

{

checkboxCell = cell.get_row().get_cellByColumnKey("FirstColumn");

if (!checkboxCell.get_element().firstChild.checked)

eventArgs.set_cancel(true);

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: