PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 27, 2022

[FIXED] How do I invert a kendoui grid row selection?

 October 27, 2022     javascript, jquery, kendo-grid, kendo-ui, lodash     No comments   

Issue

In a KendoUI grid with a selection set to "multiple", how do I invert a current selection?


Solution

You can do it in a simpler way:

const $grid = $("#grid").data("kendoGrid");
const $notSelected = $grid.tbody.find('> tr:not(.k-selected)');
            
$grid.clearSelection();
$grid.select($notSelected);

Dojo

Although it won't works for paged grids. I think it will need a more complex code for that. But for not paged grid its ok.



Answered By - DontVoteMeDown
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing