By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,669 Members | 1,654 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,669 IT Pros & Developers. It's quick & easy.

...Accessing a datagrid across frames...

P: n/a
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.
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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[i].type == "checkbox") if(elements[i].checked)
myCheckBoxArr.push(elements[i].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/de...sbytagname.asp
http://msdn.microsoft.com/library/de...s/elements.asp

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
"dj Bass" <sp******@hotmail.com> wrote in message
news:ug**************@TK2MSFTNGP10.phx.gbl...
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.

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.