Jquery-easyui DataGrid in checkbox multiple selection, row selection does not correspond to remove the highlight of the solution

Source: Internet
Author: User

jquery-easyui DataGrid in checkbox multiple selection, row selection does not correspond to remove the highlight of the solution

When working with a multi-select feature, Easyui-datagrid does not allow a row to be selected when handling a cell's click event.

For example, when you click "View", just to see the details, you do not need to select rows.



To complete this requirement, you only need to set the DataGrid's Checkonselect property to False.


However, when this property is set, the new problem comes up.

The current approach is to use the following code to remove the highlight: (originally intended to be processed into a checkbox selected row highlighting, but just start using easyui not enough)

Onselect:function (RowIndex, RowData) {$ (' #datagrid2 '). DataGrid (' Unselectrow ', rowIndex);},oncheckall:function ( rows) {$ (' #datagrid2 '). DataGrid (' Unselectall ');}  

After using the above code, to obtain the row data that is selected by the checkbox, use the following code:

var CheckedItems = $ (' #datagrid2 '). DataGrid (' getchecked ');

Starting with this line of code has always returned only one row of data, and then carefully looked at the next, this line of code use is also a prerequisite, that is, you must specify IDfield.


If you think of a way to do this, the checkbox is highlighted and will continue to be added.






Jquery-easyui DataGrid in checkbox multiple selection, row selection does not correspond to remove the highlight of the solution

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.