質問編集履歴

1

コードの添付

2018/06/05 07:01

投稿

hinoko58
hinoko58

スコア112

test CHANGED
File without changes
test CHANGED
@@ -26,4 +26,68 @@
26
26
 
27
27
 
28
28
 
29
+ 問題になる部分は以下ソースですが。$.fn.w2menuClickがないというエラーを出力していました。
30
+
31
+ ちなみにこのscriptは自分が書いたものではなく、w2ui-1.5.rc1.js(w2ui.com)のtoolbar該当部分の抜粋です。
32
+
33
+
34
+
35
+
36
+
37
+ ```javascript
38
+
39
+ $.fn.w2menuClick = function (event, index) {
40
+
41
+ var keepOpen = false;
42
+
43
+ if (['radio', 'check'].indexOf(options.type) != -1) {
44
+
45
+ if (event.shiftKey || event.metaKey || event.ctrlKey) keepOpen = true;
46
+
47
+ }
48
+
49
+ if (typeof options.onSelect === 'function') {
50
+
51
+ // need time so that menu first hides
52
+
53
+ setTimeout(function () {
54
+
55
+ options.onSelect({
56
+
57
+ index: index,
58
+
59
+ item: options.items[index],
60
+
61
+ keepOpen: keepOpen,
62
+
63
+ originalEvent: event
64
+
65
+ });
66
+
67
+ }, 10);
68
+
69
+ }
70
+
71
+ // do not uncomment (or enum search type is not working in grid)
72
+
73
+ // setTimeout(function () { $(document).click(); }, 50);
74
+
75
+ // -- hide
76
+
77
+ var div = $('#w2ui-overlay'+ name);
78
+
79
+ div.removeData('keepOpen');
80
+
81
+ if (typeof div[0].hide === 'function' && !keepOpen) {
82
+
83
+ div[0].hide();
84
+
85
+ }
86
+
87
+ };
88
+
89
+ ```
90
+
91
+
92
+
29
93
  よろしくおねがいします。