473,385 Members | 1,331 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 2419
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Andy Fish | last post by:
Hi, I have a javascript solution where page A launches page B in a second window and then they can pass data between them. That's all well and good. Now say page B wants to navigate to page C...
3
by: tungchau81 | last post by:
Hi, A Modal Dialog does not allow us to highlight the text content inside <DIV> tag unless I use a <textarea> tag to display that text content. However, the situation of my software makes it...
4
by: jesse.hartwick | last post by:
Hey group! I have a toolbar with a "DEVELOPER" menu. I have it so that it when the menu title is clicked, a pop-up form will appear if the user has not yet verified that he or she has developer...
3
by: Tim | last post by:
Hi, I am trying to pass a SQL Command, complete with parameters and their values from one form to a modal form. The modal form has; public void...
2
by: Brian Henry | last post by:
If i have a window showing like this <script>window.showModalDialog('../weblinks/default.aspx','','unadorned:yes' );</script> how can i get it to return a value to its calling page? I want to...
3
by: Chris | last post by:
I have a modal (yes it must be modal) web page. I do this by having an empty frame that points to my main page (so that I can repost without new popups) I have to pass data to the child page from...
6
by: kath | last post by:
hi everyone......... I have a task, I have fragmented the task into subtask. I have planned to create a class to each subclass and one parent class to handle the sub tasks. Each subclass are...
1
by: ram.gct | last post by:
Hi, I have an IE modal window created with showModalDialog() in javascript. Is there a way I can disable the system menu that appears when we left click on top left corner of the modal window . ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.