When the jquery-easyui datagrid is selected multiple times in the checkbox, the row selection does not match, removing the highlighted Solution

Source: Internet
Author: User

When the jquery-easyui datagrid is selected multiple times in the checkbox, the row selection does not match, removing the highlighted Solution
When multiple columns are selected in the checkbox, the row selection of the jquery-easyui datagrid does not match.

The easyui-datagrid with multiple-choice function is used in the work. When processing cell click events, the demands of the selected rows are not allowed.

For example, when you click "View", you only need to view the details, rather than selecting rows.



<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + forward + zcvm1q6z9s/WwcuhozwvcD4KPHA + PGltZyB3aWR0aD0 = "400" height = "100" src = "http://www.bkjia.com/uploads/allimg/141030/04252J155-1.png" alt = "\">

The current method is to use the following code to remove the highlight: (originally, it was intended to process the row highlighted in the checkbox, but it was not enough to use easyui at the beginning)

onSelect:function(rowIndex, rowData){ $('#datagrid2').datagrid('unselectRow',rowIndex);},onCheckAll:function(rows){ $('#datagrid2').datagrid('unselectAll');}  

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

var checkedItems = $('#datagrid2').datagrid('getChecked');

At first, this line of code always returns only one row of data. Later, I checked it carefully. This line of code is also required to specify idField.


If you want to highlight the row selected in the checkbox, you will continue to add it.




Zookeeper

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.