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

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, jqueryeasyui
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.



To meet this requirement, you only need to set the checkOnSelect attribute of the datagrid to false.


However, when this attribute is set, a new problem arises.

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
The check box of the row selected by jquery-easyui is not automatically selected.

Wrw.bh

How does jquery easyui obtain the id of the selected checkbox and delete its pages, including database data? This is what I wrote on the front-end page.

It's just a traversal thing.
OnLoadSuccess: function () {// obtain all checkbox traversal after loading
$ ('# Dbgrid input: checkbox'). each (function (index, el ){
If (/*. condition. */) el. disabled = true;
});
}

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.