...Accessing a datagrid across frames...

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.
 
V

Vidar Petursson

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
==============================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

asp:menu across 2 frames 1
Accessing other Frames components 2
Frames 1
Frames and Response.Redirect / Response.Write - Refresh 2
Transfer DataGrid across frames 1
Frames... 0
Frames 1
ASP.NET Forms + Frames 1

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top