I want to delete items from my list only if they're checked.
Unfortunately, the Ext.each loop does not seem to be smart enough to know that my list is getting shorter. So by the time it gets to the end, it is trying to delete more items than currently exist.
Here is the code snippet:
So I check B, then click 'Clear Checked'. Here's the output:
lineItems = Ext.getCmp("myList_textpanel").items.items;
var objIsChecked = o.items.items.checked;
var objText = o.items.items.text
console.log('checking ' + objText)
console.log('DELETING ' + objText)
Uncaught TypeError: Cannot read property 'items' of undefined
Notice that C is missing. Not only has it skipped over C, but when it gets to the end of the list, it finds itself one short. I was under the impression that a 'For each' operates ON the object, not on a prebuilt reference to where the object was.
(Maybe I can go through the list in reverse order?)