...Accessing a datagrid across frames...

  • Thread starter Thread starter dj Bass
  • Start date Start date
D

dj Bass

I've got a situaion where there's one frame with a load of buttons, acting
as a small control panel, with a datagrid object existing in another frame.

On clicking on one button on the top frame, I want to be able to access the
instance that is being displayed onscreen of the grid, because it contains,
among other things, a column of check boxes, who's state is lost if i
manually refresh it from the other frame via scripting.

What I want to do is when clicking a button in the top, pick out all items
in the datagrid in the frame below that have been "selected", that is,
checked off.

Any ideas as to an approach for this?
Is there a way, for example, to access the object in another page as it
exists, and drive it externally, calling methods on already existing
instance of that object?

Thanks for your comments.
Daniel.
 
Hi

I am not totally sure what you want... Do you simply want to store the
checked checkboxes in the other frame?

var myCheckBoxArr = new Array();
function storeCheckedBoxes(){
with(parent.FRAMENAME.document.forms[0])
{
for(i=0;i<elements.length;i++)
{
if(elements.type == "checkbox") if(elements.checked)
myCheckBoxArr.push(elements.name);
}
}
}

This will store the checked checkboxes names in the Array

Or for newer browsers
document.getElementsByTagName("CHECKBOX");

More info
http://msdn.microsoft.com/library/d...ml/reference/methods/getelementsbytagname.asp
http://msdn.microsoft.com/library/d...thor/dhtml/reference/collections/elements.asp

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
 
Back
Top