在我的网格中,我应该能够根据从 web 服务返回的状态来拥有复选框和字符串数据。现在我正在编写下面给出的自定义渲染器函数:函数 customcolumn1(值,元数据,记录){
var completedTime = record.get('nccompletedTime');
var completedByLastName = record.get('nccompletedByLastName');
var completedByFirstName = record.get('nccompletedByFirstName');
if (value == 'Completed') {
return completedTime + " " + completedByLastName + "," + completedByFirstName;
} else if (value == 'Pending') {
return "<input type='checkbox' disabled>";
} else if (value == 'Assigned') {
return "<input type='checkbox'>";
}
}
网格是
var SAFjobgrid = Ext.create('Ext.grid.Panel', {
store: store,
columns: [
{
text: "",
width: 30,
renderer: customSeqNumber,
dataIndex: 'sequenceNumber'},
{
text: "Task",
width: 350,
renderer: customTask,
dataIndex: 'label'},
{
text: "Complete",
width: 160,
renderer: customcolumn2,
dataIndex: 'stampActionStatus'},
{
text: "Verified",
width: 160,
renderer: customcolumn,
dataIndex: 'verifyActionStatus'},
{
text: "Non Compliance",
flex: 1,
renderer: customcolumn1,
dataIndex: 'ncActionStatus'}
]
});
现在我想检查复选框并捕获这些记录的 stampIds。当我单击网格之外的更新按钮时,我应该能够使用捕获的 stampId 调用 web 服务。我尝试将 onclick 事件放在从渲染器功能返回时的复选框。但是我应该如何访问该记录的stampId。如果我选择多个复选框,多个stampid应该转到webservice,如果我取消选中该复选框,相应的stampid应该从stampId中删除。有人可以帮忙解决这个吗..