I have the following setup:
I am using a panel to enable an accordion control. I am loading grids into the source list, and need to ensure that when a row is selected in one grid, the selected options in the other grids are cleared. anyone have any insight?
J.
3 Answers, 1 is accepted
0
Dimo
Telerik team
answered on 14 Jun 2012, 08:20 AM
Hi Joey,
Since the Kendo UI Grids do not have a built-in inter-communication mechanism, you can achieve the desired behavior if you manually remove the selected CSS classes (k-state-selected) from the other Grids. Use the select event of the current Grid and jQuery's removeClass.
Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
How do I select the other grids and remove their classes without impacting the currently selected Grid\item?
Here's my current code snippet I'm using:
$("table").each(function () {
$(this).kendoGrid({
selectable: "row",
change: function () {
var SelectedGrid = this;
var dataItem = SelectedGrid.dataItem($(this.select()));
//Get the tables
var kendoGrids = $($.find(".k-content")).find(".k-state-selected").parent();
debugger;
if (kendoGrids.length > 1) {
var kendoThis = kendoGrids.find("[data-uid ='" + dataItem.uid + "']");
var kendoAint = kendoGrids.not(this.content);
debugger;
$.grep(kendoGrids, function (value) {
//need to return the grid item where it is not the current one...
//var grepVal = $($(value).parents("table")).find("[data-uid='" + dataItem.uid + "']");
//value of
var ValidSelect = $($(value).parents("table")).find("[data-uid='" + dataItem.uid + "']");
var inValidSelect = $($(value).parents("table")).find("[data-uid !='" + dataItem.uid + "']");