Row selection with Checkbox in RadGrid is not working after upgrading jQuery version

1 Answer 86 Views
Control Panel Upgrade
S
Top achievements
Rank 1
S asked on 19 Apr 2023, 08:57 PM

I am using telerik version 2014.3.1024.45 with Asp.Net Webforms and Recently i have upgraded to jQuery Version from 2.0.3 to 3.6.3.

i am using Telerik Grid control in my application. Every row in a grid has a checkbox. if clicked on checkbox or on a row, that particular row will get selected. This functionality is used to work with jQuery 2.0.3. but after upgrading jQuery Version to 3.6.3, row is getting selected only when clicked on row, row is not getting selected when clicked on checkbox.



1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 24 Apr 2023, 06:11 AM

Hi,

Could you please confirm which Kendo UI for the jQuery version you are using? In the Dojo linked here, you will find an example of checkbox selection in Grid with jQuery 3.6.3 and Kendo's latest version. 

However, please note that even the latest Kendo UI for the jQuery version is not fully tested with jQuery 3.6.3, but it is compatible with jQuery 3.6.1. You can find the full list with the compatible versions in the link below:

https://docs.telerik.com/kendo-ui/intro/supporting/jquery-support

Let me know in case you have additional questions.

Regards,
Neli
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

S
Top achievements
Rank 1
commented on 24 Apr 2023, 12:35 PM | edited

Hi,

Thank you for your prompt response.

I appreciate your suggestion to check the Kendo UI version compatibility with jQuery 3.6.3. However, I would like to clarify that I am not using Kendo UI in my application. I am using the Telerik version 2014.3.1024.45 with ASP.NET Webforms and Telerik Grid control.

Therefore, I would appreciate any suggestions or recommendations regarding how to address this issue with Telerik Grid and jQuery 3.6.3.

// Define the handler for the checkbox click and change events
var checkboxQuery = 'input[type="checkbox"]';
$view.on('click change', checkboxQuery, function () {
  updateCheckBox($(this)); // Call the UpdateCheckBox function
});

// Define the handlers for row selection and deselection events
function onRowSelectionChanged(o: RadGrid, e: GridDataItemEventArgs) {
  // Update the header checkboxes
}

// Remove any existing event handlers for row selection and deselection grid.remove_rowSelected(onRowSelectionChanged); grid.remove_rowDeselected(onRowSelectionChanged); // Add the event handlers for row selection and deselection grid.add_rowSelected(onRowSelectionChanged); grid.add_rowDeselected(onRowSelectionChanged);




class RadGrid extends RadWebControl {

    add_rowSelected(handler: (o: RadGrid, e: GridDataItemEventArgs) => void);
      remove_rowSelected(handler: (o: RadGrid, e: GridDataItemEventArgs) => void);

      add_rowDeselected(handler: (o: RadGrid, e: GridDataItemEventArgs) => void);
      remove_rowDeselected(handler: (o: RadGrid, e: GridDataItemEventArgs) => void);

}


This code was working in JQuery 2.0.3. but in JQuery 3.6.3, onRowSelectionChanged is not getting called. 

In this code, the event handler for the checkbox click and change events is defined first. This handler calls the UpdateCheckBox function, which presumably updates the selected state of the row or checkbox.

Then, the event handlers for row selection and deselection are defined. These handlers update the header checkboxes, based on the selected state of the rows.

Next, any existing event handlers for row selection and deselection are removed from the grid object, to avoid duplicate event handling.

Finally, the event handlers for row selection and deselection are added to the grid object.

Thank you for your assistance.

Rumen
Telerik team
commented on 27 Apr 2023, 03:37 AM

This forum post is a duplicate of this one Row selection with Checkbox in RadGrid is not working after upgrading jQuery version

For reference, I am sharing the reply from the other thread:

Telerik UI for ASP.NET AJAX does not offer official support for jQuery 3.x simply because the MS AJAX framework is not compatible with it officially. You can find more information in the docs: Embedded jQuery Security.

On a side note, version 2014.3.1024 is vulnerable to a number of critical vulnerabilities as noted in these resources:

and it is strongly recommended to upgrade to at least 2020.1.114 or even better to its latest version 2023.1.323 which also supports all modern browsers, and provides many new UI controls and features, security, and stability enhancements.

Tags
Control Panel Upgrade
Asked by
S
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or