pass values to selection menu in modal window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sharon

    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.c lassName=''};
    if (!Value) {selectedItem=p arentByTag('TR' )} else
    {selectedItem=d ocument.getElem entById(Value)} ;
    if (!!selectedItem ){selectedItem. className='sele cted'};

    }

    And here's what I have so far regarding the modal dialog...Probab ly
    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.showM odalDialog('/lib/xtable/target.html','' ,'dialogWidth:4 00px;
    dialogHeight:20 px; 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'!
  • Dominique

    #2
    Re: pass values to selection menu in modal window

    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" <esdeees@hotmai l.com> wrote in message
    news:2b13d59b.0 405060558.574c4 c29@posting.goo gle.com...[color=blue]
    > 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.c lassName=''};
    > if (!Value) {selectedItem=p arentByTag('TR' )} else
    > {selectedItem=d ocument.getElem entById(Value)} ;
    > if (!!selectedItem ){selectedItem. className='sele cted'};
    >
    > }
    >
    > And here's what I have so far regarding the modal dialog...Probab ly
    > very lame & ugly since I have never done this before and I'm still in
    > the trying-out-phase...
    >
    > function cellClick()
    > {if[/color]
    (event.button== 2){window.showM odalDialog('/lib/xtable/target.html','' ,'dialo
    gWidth:400px;[color=blue]
    > dialogHeight:20 px; 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'![/color]


    Comment

    • Sharon Steringa

      #3
      Re: pass values to selection menu in modal window

      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!

      Comment

      • Sharon Steringa

        #4
        Re: pass values to selection menu in modal window

        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(cur rent())]/@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:


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

        Comment

        Working...