|
5 | 5 |
|
6 | 6 | <style type="text/css">
|
7 | 7 | .hasmenu {
|
8 |
| - border: 1px solid #008; |
9 |
| - margin: 3px; |
10 |
| - padding: 5px; |
11 |
| - width: 30px; |
| 8 | + border: 1px solid #008; |
| 9 | + margin: 3px; |
| 10 | + padding: 5px; |
| 11 | + width: 30px; |
12 | 12 | }
|
13 | 13 | .ui-widget{
|
14 |
| - font-size: .8em; |
| 14 | + font-size: .8em; |
15 | 15 | }
|
16 | 16 | table, td {
|
17 | 17 | border: 1px solid dimgray;
|
|
21 | 21 | <script type="text/javascript">
|
22 | 22 | $(document).ready(function () {
|
23 | 23 |
|
24 |
| - function action (event, ui) { |
25 |
| - console.log(ui.target); |
26 |
| - }; |
| 24 | + function action (event, ui) { |
| 25 | + console.log(ui.target); |
| 26 | + }; |
27 | 27 |
|
28 |
| - $("#details").contextmenu({ |
29 |
| - delegate: ".hasmenu", |
30 |
| - menu: [ |
31 |
| - {title: "Option 1 title", cmd: 'opt1', action: action}, |
32 |
| - {title: "-" }, |
33 |
| - {title: "Option 2 title", cmd: 'opt2', action: action} |
34 |
| - ], |
35 |
| - beforeOpen: function(event, ui) { |
36 |
| - var titleText = 'record ' + ui.target.parent().attr('record'); |
37 |
| - $("#details").contextmenu("setEntry", "opt1", {title: titleText}); |
38 |
| - $("#details").contextmenu("setEntry", "opt2", titleText); |
39 |
| - } |
40 |
| - }); |
| 28 | + $("#details").contextmenu({ |
| 29 | + delegate: ".hasmenu", |
| 30 | + menu: [ |
| 31 | + {title: "Option 1 title", cmd: 'opt1', action: action}, |
| 32 | + {title: "-" }, |
| 33 | + {title: "Option 2 title", cmd: 'opt2', action: action} |
| 34 | + ], |
| 35 | + beforeOpen: function(event, ui) { |
| 36 | + var titleText = 'record ' + ui.target.parent().attr('record'); |
| 37 | + $("#details").contextmenu("setEntry", "opt1", {title: titleText}); |
| 38 | + $("#details").contextmenu("setEntry", "opt2", {uiIcon: "ui-icon-closethick"}); |
| 39 | + $("#details").contextmenu("getMenu"); |
| 40 | + // $("#details").contextmenu("setEntry", "opt2", titleText); |
| 41 | + } |
| 42 | + }); |
41 | 43 |
|
42 | 44 | });
|
43 | 45 | </script>
|
44 | 46 |
|
45 | 47 | <table id="details" class="table">
|
46 | 48 | <thead>
|
47 |
| - <tr> |
48 |
| - <th>Id</th> |
49 |
| - <th>File Name</th> |
50 |
| - <tr /> |
| 49 | + <tr> |
| 50 | + <th>Id</th> |
| 51 | + <th>File Name</th> |
| 52 | + <tr /> |
51 | 53 | </thead>
|
52 | 54 | <tbody>
|
53 |
| - <tr record="1" class="hasmenu"> |
54 |
| - <td>1</td> |
55 |
| - <td>Record 1</td> |
56 |
| - </tr> |
57 |
| - <tr record="2" class="hasmenu"> |
58 |
| - <td>2</td> |
59 |
| - <td>Record 2</td> |
60 |
| - </tr> |
| 55 | + <tr record="1" class="hasmenu"> |
| 56 | + <td>1</td> |
| 57 | + <td>Record 1</td> |
| 58 | + </tr> |
| 59 | + <tr record="2" class="hasmenu"> |
| 60 | + <td>2</td> |
| 61 | + <td>Record 2</td> |
| 62 | + </tr> |
61 | 63 | </tbody>
|
62 | 64 | </table>
|
0 commit comments