📅  最后修改于: 2023-12-03 15:16:41.144000             🧑  作者: Mango
The jqGrid navButtonAdd is a method in Javascript that allows you to add custom buttons to the navigation bar of your jqGrid. This method is super useful and can improve the user experience by providing quick access to frequently used functions.
navButtonAdd (grid_id, pager_id, options, separator)
Here's an example of how to use the navButtonAdd() method in your Javascript code:
$("#myGrid").jqGrid('navButtonAdd','#myPager',{
caption:"My Button",
buttonicon:"ui-icon-plus",
onClickButton: function(){ alert("Hello World"); },
position: "last"
});
This will add a button to the end of the navigation bar with a caption "My Button", an icon "ui-icon-plus", and an alert when clicked.
Here are some of the most commonly used options for jqGrid navButtonAdd():
The jqGrid navButtonAdd method is a great way to add custom buttons to your jqGrid navigation bar. It's easy to use and can improve the user experience by providing quick access to frequently used functions. With many options available, you can easily customize the buttons to fit your needs.