I have a fromPanel
and I'm trying to achieve the following:
var linkPanel = new Ext.FormPanel({
...
});
var records = layers_store.getRange();
for(var i = 0; i < records.length; i++) {
var layer_checked;
console.log(records[i].data);
if(records[i].data.checked == 'true') {
layer_checked = true;
} else {
layer_checked = false;
}
console.log(layer_checked);
linkPanel.add(new Ext.form.Checkbox({
boxLabel : records[i].data.layer_name,
name : records[i].data.layer_name,
checked : layer_checked,
handler : ...
}
}));
}
Also, in another part of my code, the layers_store
is being updated.
When I check the console, I see:
({layer_id:"1", layer_name:"\u041F\u0435\u0440\u0432\u044B\u0439", checked:"false"})
false
({layer_id:"2", layer_name:"\u0412\u0442\u043E\u0440\u043E\u0439", checked:"true"})
true
This indicates that the first checkbox should be unchecked. However, it remains checked for some reason.
What could be going wrong?
edit: