Jqgridjqgrid Table Action column, click the action button flyout layer

Source: Internet
Author: User
Tags jqgrid

When using Jqgrid, the last column in the table is the Action column, and each row in the Action column has an action button that resembles a drop-down menu, as shown below:


When you click on the "Action" column in the table, you need to pop up a div layer that contains a bunch of buttons to manipulate the table row, as follows:


The steps to resolve are as follows:

1. First, add the attribute edittype: ' Select ' and method Formatter:groupGrid.formatOptions on the columns in Colmodel, as shown below:


Easy to copy, the code is as follows:

{label: ' Operation ', Name: ' Operations ', Index: ' Operations ', width:80, sortable:false,align: ' Center ', cellattr:addcellattr,
	editable:true,edittype: ' select ', Formatter:groupGrid.formatOptions
}
The Formatoptions method is shown in the following diagram, and the HTML code is spliced in the method:


Description: One of the single quotes I used was "\" to escape. The parameter values in the request URL are obtained from the rowobject .
2, second, the above code to add a table in the processing Operation button, but only the Operation button, when the "Action" button when the pop-up layer is obscured by table row, that is, the table row below the bottom, so do not see the desired pop-up layer, which is jqgrid left the pit, After a few battles and struggles, I find that I need to set up CSS styles myself.

The solution is as follows:

A, add the attribute cellattr, its value is set to "Addcellattr", namely:

Cellattr:addcellattr

B, write the Addcellattr method event, as shown below:


Easy to copy, the code is as follows:

function Addcellattr (RowId, Val, rawobject, CM, rdata) {
	return "style= ' overflow:visible; '";
}
The effect of adding a good post-implementation is as follows:



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.