problem with plugin contextmenu
Hi,
i'm using jQuery plugin contextMenu and i have a problem to get the 3 firts values of elements TD of my dynamic table.
- For example,if i make a right clic and clic on details, i want to get the 3 firts values of TD. here is the code: <?php if(isset($this->errorMessage))
- {
- echo $this->errorMessage;
- }
- ?>
- <html>
- <head>
- <title></title>
- <script type="text/javascript" src="<?php echo $this->baseUrl();?>/js/jquery-1.4.2.js"></script>
- <script type="text/javascript" src="<?php echo $this->baseUrl();?>/js/jquery.contextMenu.js"></script>
- <link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl();?>/css/jquery.contextMenu.css" />
- <script type="text/javascript">
- $(document).ready( function() {
- // Show menu when #myDiv is clicked
- $("#myDiv").contextMenu({
- menu: 'myMenu'
- },
- $('table td').click(function(){
- var recupNum = $(this).parent().attr('id') ;
- alert(+recupNum);
- }));
-
- // Enable menus
- $("#enableMenus").click( function() {
- $('#myDiv, #myList UL LI').enableContextMenu();
- $(this).attr('disabled', true);
- $("#disableMenus").attr('disabled', false);
- });
- });
- </script>
- </head>
- <body>
- <table cellspacing="0" cellpadding="0" width="850px" border="2">
- <tr style="font-weight:bold"><td width="79px">Numéro</td><td width="263px">Niveau</td><td width="152px">Année Début</td><td width="152px">Année Fin</td><td>Total des frais</td></tr>
- </table>
- <table id="myDiv" cellspacing="0" cellpadding="0" width="850px" border="2">
- <?php
- $i= 1 ;
- foreach($this->objRowFraisNiveau as $resultat):
- {
- ?>
- <tr><td align="center"><?php echo $resultat["idNiveau"]; ?></td><td align="center"><?php echo $resultat["anneeDebut"]; ?></td><td align="center"><?php echo $resultat["anneeFin"]; ?></td><td align="center"><?php echo $resultat["total"]; ?></td></tr>
- <?php
- }
- endforeach ;
- ?>
- </table>
- <script type="text/javascript">
- $(document).ready(function() {
- $('table#filterTable1').columnFilters({alternateRowClassNames:['rowa','rowb']});
- });
- </script>
- <ul id="myMenu" class="contextMenu">
- <li class="edit"><a href="<?php echo $this->url(array('module'=>'inscription','controller'=>'index','action'=>'accueilaide')); ?>">Détails</a></li>
- </ul>
- </body>
- </html>
can i have help please ???? Thanks