@@ -598,9 +598,14 @@ Appends an item to a **ContextMenu** in the specified referenceItem's sub menu (
598
598
<div id="target">Target</div>
599
599
<ul id="context-menu"></ul>
600
600
<script>
601
+ // initialize the ContextMenu
602
+ $("#context-menu").kendoContextMenu({
603
+ target: "#target"
604
+ });
605
+
601
606
// get a reference to already initialized ContextMenu widget
602
607
var contextMenu = $("#context-menu").data("kendoContextMenu");
603
- //
608
+
604
609
contextMenu.append(
605
610
[{
606
611
text: "Item 1",
@@ -667,6 +672,10 @@ Closes the **ContextMenu**. This method can be prevented to stop the closure.
667
672
</li>
668
673
</ul>
669
674
<script>
675
+ // initialize the ContextMenu
676
+ $("#context-menu").kendoContextMenu({
677
+ target: "#target"
678
+ });
670
679
// get a reference to the ContextMenu widget
671
680
var contextMenu = $("#context-menu").data("kendoContextMenu");
672
681
// close the ContextMenu
@@ -708,6 +717,11 @@ Prepares the **ContextMenu** for safe removal from DOM. Detaches all event handl
708
717
</li>
709
718
</ul>
710
719
<script>
720
+ // initialize the ContextMenu
721
+ $("#context-menu").kendoContextMenu({
722
+ target: "#target"
723
+ });
724
+
711
725
var contextMenu = $("#context-menu").data("kendoContextMenu");
712
726
713
727
// detach events
@@ -739,6 +753,10 @@ initialization by setting the **disabled="disabled"** on the desired menu item h
739
753
</li>
740
754
</ul>
741
755
<script>
756
+ // initialize the ContextMenu
757
+ $("#context-menu").kendoContextMenu({
758
+ target: "#target"
759
+ });
742
760
// get a reference to the ContextMenu widget
743
761
var contextMenu = $("#context-menu").data("kendoContextMenu");
744
762
// disable the li menu item with the id "secondItem"
@@ -783,6 +801,10 @@ Inserts an item into a **ContextMenu** after the specified referenceItem.
783
801
</li>
784
802
</ul>
785
803
<script>
804
+ // initialize the ContextMenu
805
+ $("#context-menu").kendoContextMenu({
806
+ target: "#target"
807
+ });
786
808
// get a reference to the ContextMenu widget
787
809
var contextMenu = $("#context-menu").data("kendoContextMenu");
788
810
//
@@ -852,6 +874,10 @@ Inserts an item into a **ContextMenu** before the specified referenceItem.
852
874
</li>
853
875
</ul>
854
876
<script>
877
+ // initialize the ContextMenu
878
+ $("#context-menu").kendoContextMenu({
879
+ target: "#target"
880
+ });
855
881
// get a reference to the ContextMenu widget
856
882
var contextMenu = $("#context-menu").data("kendoContextMenu");
857
883
//
@@ -921,6 +947,10 @@ Shows the **ContextMenu** at the specified coordinates in pixels or aligned to t
921
947
</li>
922
948
</ul>
923
949
<script>
950
+ // initialize the ContextMenu
951
+ $("#context-menu").kendoContextMenu({
952
+ target: "#target"
953
+ });
924
954
// get a reference to the ContextMenu widget
925
955
var contextMenu = $("#context-menu").data("kendoContextMenu");
926
956
// open the ContextMenu at 100px, 100px
@@ -965,6 +995,10 @@ Removes a specified item(s) from a **ContextMenu**.
965
995
</li>
966
996
</ul>
967
997
<script>
998
+ // initialize the ContextMenu
999
+ $("#context-menu").kendoContextMenu({
1000
+ target: "#target"
1001
+ });
968
1002
// get a reference to the ContextMenu widget
969
1003
var contextMenu = $("#context-menu").data("kendoContextMenu");
970
1004
// remove the item with the id "Item1"
@@ -1053,6 +1087,10 @@ The jQuery event that triggered this one - only available for the close event of
1053
1087
</li>
1054
1088
</ul>
1055
1089
<script>
1090
+ // initialize the ContextMenu
1091
+ $("#context-menu").kendoContextMenu({
1092
+ target: "#target"
1093
+ });
1056
1094
// get a reference to the ContextMenu widget
1057
1095
var contextMenu = $("#context-menu").data("kendoContextMenu");
1058
1096
// bind to the close event
@@ -1131,6 +1169,10 @@ The jQuery event that triggered this one - only available for the open event of
1131
1169
</li>
1132
1170
</ul>
1133
1171
<script>
1172
+ // initialize the ContextMenu
1173
+ $("#context-menu").kendoContextMenu({
1174
+ target: "#target"
1175
+ });
1134
1176
// get a reference to the ContextMenu widget
1135
1177
var contextMenu = $("#context-menu").data("kendoContextMenu");
1136
1178
// bind to the open event
@@ -1205,6 +1247,10 @@ The current target of the ContextMenu - either the init target or the current el
1205
1247
</li>
1206
1248
</ul>
1207
1249
<script>
1250
+ // initialize the ContextMenu
1251
+ $("#context-menu").kendoContextMenu({
1252
+ target: "#target"
1253
+ });
1208
1254
// get a reference to the ContextMenu widget
1209
1255
var contextMenu = $("#context-menu").data("kendoContextMenu");
1210
1256
// bind to the activate event
@@ -1279,6 +1325,10 @@ The current target of the ContextMenu - either the init target or the current el
1279
1325
</li>
1280
1326
</ul>
1281
1327
<script>
1328
+ // initialize the ContextMenu
1329
+ $("#context-menu").kendoContextMenu({
1330
+ target: "#target"
1331
+ });
1282
1332
// get a reference to the ContextMenu widget
1283
1333
var contextMenu = $("#context-menu").data("kendoContextMenu");
1284
1334
// bind to the deactivate event
@@ -1353,11 +1403,14 @@ The current target of the ContextMenu - either the init target or the current el
1353
1403
</li>
1354
1404
</ul>
1355
1405
<script>
1406
+ // initialize the ContextMenu
1407
+ $("#context-menu").kendoContextMenu({
1408
+ target: "#target"
1409
+ });
1356
1410
// get a reference to the ContextMenu widget
1357
1411
var contextMenu = $("#context-menu").data("kendoContextMenu");
1358
1412
// bind to the select event
1359
1413
contextMenu.bind("select", function(e) {
1360
1414
// handle event
1361
1415
});
1362
1416
</script>
1363
-
0 commit comments