469,934 Members | 2,607 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

pass values to selection menu in modal window

Hi y'all,
I'm trying to figure out how to tackle this problem: I have an XML
table with a cool grid in which users can select a table row. When
they right-click on a cell, they get a modal dialog window with a
selection menu. What I want this thing to do is display the different
values in the row, so that users can make a selection: eventually I
want it to be a filter option > in the selection menu, users can
select the value on which they want the whole table to be filtered.
However, I'm seriously lacking js-skills so I don't know how I should
pass the values from the table row to the selection menu. I hope
someone can give me a hint...

Here's the function that selects a row in the table:

function rowClick(Value)
{
if (!!selectedItem) {selectedItem.className=''};
if (!Value) {selectedItem=parentByTag('TR')} else
{selectedItem=document.getElementById(Value)};
if (!!selectedItem){selectedItem.className='selected' };

}

And here's what I have so far regarding the modal dialog...Probably
very lame & ugly since I have never done this before and I'm still in
the trying-out-phase...

function cellClick()
{if (event.button==2){window.showModalDialog('/lib/xtable/target.html','','dialogWidth:400px;
dialogHeight:20px; center: yes; edge: raised; help: no; resizable:
yes; scroll: no; status: no;');
}
}

Thanks very much, hope I have provided enough information, if not I'll
be quick to add some mo'!
Jul 23 '05 #1
3 2295
i think you should rather use a contextmenu instead...
sending info to and from modal windows is a tricky job, because a modal
window does not have any of the proeprties an internet explorer window does.

confused?

a modal window is an inherent operating system HTML parser, not a browser
window,
which is why it loads so quickly, it doesn't have to load all the IE objects
before parsing the html.

try www.dynamicdrive.com
and look for scripts on contextmenus. I prefer to do my own menus and stuff
cause free scripts get a little cluttered and messy

"Sharon" <es*****@hotmail.com> wrote in message
news:2b**************************@posting.google.c om...
Hi y'all,
I'm trying to figure out how to tackle this problem: I have an XML
table with a cool grid in which users can select a table row. When
they right-click on a cell, they get a modal dialog window with a
selection menu. What I want this thing to do is display the different
values in the row, so that users can make a selection: eventually I
want it to be a filter option > in the selection menu, users can
select the value on which they want the whole table to be filtered.
However, I'm seriously lacking js-skills so I don't know how I should
pass the values from the table row to the selection menu. I hope
someone can give me a hint...

Here's the function that selects a row in the table:

function rowClick(Value)
{
if (!!selectedItem) {selectedItem.className=''};
if (!Value) {selectedItem=parentByTag('TR')} else
{selectedItem=document.getElementById(Value)};
if (!!selectedItem){selectedItem.className='selected' };

}

And here's what I have so far regarding the modal dialog...Probably
very lame & ugly since I have never done this before and I'm still in
the trying-out-phase...

function cellClick()
{if (event.button==2){window.showModalDialog('/lib/xtable/target.html','','dialo
gWidth:400px; dialogHeight:20px; center: yes; edge: raised; help: no; resizable:
yes; scroll: no; status: no;');
}
}

Thanks very much, hope I have provided enough information, if not I'll
be quick to add some mo'!

Jul 23 '05 #2
Okay, thanks! That was actually my initial approach, but since I
couldn't get anything to work on that (the only thing that worked was
disabling the default context menu), I thought maybe a modal window
would be easier... So now you're telling me it isn't :-). My poor
js-skills are the main reason for my lack of success with the
contextmenu-thing, so I'll try again. I'll check out the scripts and
hope I will be more successful this time, thanks for your tip!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3
So I found some great sample code, thanks! However, they are meant to be
put in the <body> section of my html-page. Problem is: I have an
xsl-sheet, and want the contextmenu to appear only when a table cell is
clicked, so only within the table. I would have to add an onclick-event
or something to the <td> of my xsl:

<xsl:if
test="/general/data/cols/*[name()=name(current())]/@visible='True'">
<td>
<xsl:value-of select="@value"/>
</td>
</xsl:if>

and call the appropriate js-function from an external js-file. I've
tried this, but I keep getting error messages... Does anyone know how I
should modify this code so that I can put it in my external js-file and
call it from within my <td> in my xsl-sheet? The contextmenucode can be
found here:
http://www.dynamicdrive.com/dynamici...tmenu2_dev.htm

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by jesse.hartwick | last post: by
2 posts views Thread by Brian Henry | last post: by
3 posts views Thread by Chris | last post: by
6 posts views Thread by kath | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.