We have added two methods: colMenuAdd and colMenuDelete.
colMenuAdd has the following parameters
colMenuAdd( colname, options);
colname (string) should correspond to colname in colModel, where the menu will be added. If the special word all is set the colMenu item will be added to all columns.
options (object) – default values of this object are:
1
2
3
4
5
6
7
title:'Item',
icon:styles.icon_new_item,
funcname:null,
position:"last",
closeOnRun:true,
exclude:"",
id:null
title – text which will appear in menu icon – icon associated with this item funcname – the function name to be executed – NOTE tha this should be a valid function name and not a string. The item can not be set as
funcname : function() {…},
but as
funcname : myfunction,
where myfunction is a defined before function. You can use this in the defined function to refer to jqGrid object and can obtain all parameters of the grid. position – can be first or last closeOnRun – when true menu will be closed after the custom function (funcname) is executed. exclude – string – columns on which the menu will not be added when the colname is set to all. To exclude more columns use a comma. id uniquie string to identify the menu. It is preferd way to add this optuion if you plan to delete dynamically a menu. If not set the method use a random id to set it.
colMenuDelete( id ) – dynamically remove a defined menu. The parameter id should be equal of those defined in id options parameter in colMenuAdd
Please let us know if there is a problem or you have notes on the method.