Forum Discussion
spatel_1
14 years agoOccasional Contributor
Hi Mustak,
If wChecked is unavailable, you can use some native methods to acquire the same information. The method you need is FindItemWithText.
var list = your list view;
var item = list["FindItemWithText"]("MyItemText");
if(item["Checked"])
Log["Event"]("MyItemText was checked.");
else
Log["Error"]("MyItemText was not checked!");
If you don't have the FindItemWithText method, but you do have the Items Property, you can do the same thing with a little extra work.
function findItemByText(list, itemText){
var count = list["Items"]["Count"];
for(var i = 0; i < count; i++){
var item = list["Items"]["Item"](0);
if(item["Text"] == itemText){
Log["Event"]("Item with text "+itemText+" was found.");
return item;
}
}
Log["Error"]("Item with text "+itemText+" does not exist in this ListView!");
return null;
}
Then you can use the same basic procedure:
var list = your list view;
var item = findItemByText(list, "MyItemText");
if(item["Checked"])
Log["Event"]("MyItemText was checked.");
else
Log["Error"]("MyItemText was not checked!");
Stephen
If wChecked is unavailable, you can use some native methods to acquire the same information. The method you need is FindItemWithText.
var list = your list view;
var item = list["FindItemWithText"]("MyItemText");
if(item["Checked"])
Log["Event"]("MyItemText was checked.");
else
Log["Error"]("MyItemText was not checked!");
If you don't have the FindItemWithText method, but you do have the Items Property, you can do the same thing with a little extra work.
function findItemByText(list, itemText){
var count = list["Items"]["Count"];
for(var i = 0; i < count; i++){
var item = list["Items"]["Item"](0);
if(item["Text"] == itemText){
Log["Event"]("Item with text "+itemText+" was found.");
return item;
}
}
Log["Error"]("Item with text "+itemText+" does not exist in this ListView!");
return null;
}
Then you can use the same basic procedure:
var list = your list view;
var item = findItemByText(list, "MyItemText");
if(item["Checked"])
Log["Event"]("MyItemText was checked.");
else
Log["Error"]("MyItemText was not checked!");
Stephen