This is a migrated thread and some comments may be shown as answers.

Kendo Grid Locked=true not working properly

18 Answers 930 Views
Grid
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 14 Jun 2016, 07:17 AM

I am using a Kendo Grid in which all data are bounding with one fixed row checkbox as the first row of he grid (which is hard-coded) I want this row to be freezed ;For that I have used "locked = true" in the columns . But here the problem if I use this my next jquery functions are not working and foremost Let us suppose there are 10 item (pagination) for that it is showing only 9 checkboxes but If i will change item per page then It works fine how to Resolve this type of Error

 

One Doubt is

If I putting Checkbox Row as Locked=true then is it become outside of the parent Grid i.e required to find the particular check box for that row I am using parent function to find the particular check box of that row after putting locked=true then parent function is not working

 

On click of row (td)  that particular checkbox should checked and if it checked then it should uncheck

If I put locked = true then my function is not working else it's working fine 

My function are

 

 function Checkboxselection(){
$('td').click(function(){

      var finder = $(this).parent();
       console.log(finder);
      var ischecked = finder.find(".childCheckbox").prop('checked'); 
      console.log(ischecked);  
           if(ischecked==true){               
          finder.find(".childCheckbox").prop('checked',false);
        }
      else{
           finder.find(".childCheckbox").prop('checked',true);
         }  
         });  

 }

 

 

 

18 Answers, 1 is accepted

Sort by
0
M
Top achievements
Rank 1
answered on 14 Jun 2016, 07:27 AM

Hi All,

              My name is M.Gautam sorry for not introducing myself first

0
Rosen
Telerik team
answered on 16 Jun 2016, 06:41 AM

Hello M,

Indeed, when locked columns are used, the Grid content is split into two separate tables - one for the locked columns and one for the non-locked. Thus, in order the code in question to work you will need to find the associated locked row and search for the checkbox there. For example:

var grid = $("#grid").data("kendoGrid");                 
var lockedRow = grid.lockedTable.find("tr").eq(finder.index());
 
lockedRow.find(":checkbox").prop("checked", true);

Regards,
Rosen
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
M
Top achievements
Rank 1
answered on 30 Jun 2016, 06:19 AM
Any other way to do it
0
Rosen
Telerik team
answered on 04 Jul 2016, 06:01 AM
Hi,

Feel free to use an implementation for finding the associated TR element which matches your personal preferences. However the general approach and reason is this the one described in my previous message.

Regards,
Rosen
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
M
Top achievements
Rank 1
answered on 04 Jul 2016, 06:10 AM

Thank you Rosen for your Effort Actually I am new to Kendo Grid so Iam unable to find the associated locked row could you please eloberate your answer it will be appreciated for eloverating your own answer

Thanks in Advance......

0
Rosen
Telerik team
answered on 04 Jul 2016, 11:57 AM

Hello M,

Could you please elaborate a bit more about what is not clear about the snippet I have provided. 

Here is a bit more annotated version.

var finder = $(this).parent(); // the clicked row element
 
var grid = $("#grid").data("kendoGrid"); // get reference to the Grid widget
 
var lockedRow = grid
   .lockedTable // reference to the locked table
   .find("tr").eq(finder.index()); // finds the row with the same index as the one clicked (the finder)
  
// finds the checkbox inside the row and set it as checked
// here we assume that the checkbox is always inside the locked portion of the grid
lockedRow.find(":checkbox").prop("checked", true);


Regards,
Rosen
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
M
Top achievements
Rank 1
answered on 04 Jul 2016, 11:59 AM

In this what is lockedTable?

I  am unable to find it   

0
Rosen
Telerik team
answered on 05 Jul 2016, 06:23 AM

Hello,

This, as I have noted in the inline comments, is a field of the Grid widget, which holds reference to the lockedTable element. It is the same as using the following selector $("#grid").find(".k-grid-content-locked > table").

Regards,
Rosen
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
M
Top achievements
Rank 1
answered on 05 Jul 2016, 07:38 AM

I have used like that only but on using this

(var lockedRow = grid.lockedTable.find("tr").eq(finder.index());)  

it came error as ''lockedTable is undefined ''

0
Rosen
Telerik team
answered on 05 Jul 2016, 03:25 PM

Hello,

Most probably you do not have locked columns enabled or the grid variable does not reference the Grid widget instance or the code is executed before the Grid widget is content is rendered. You should provide a small test page which to demonstrate the error in question in order to further investigate your case.

Regards,
Rosen
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
M
Top achievements
Rank 1
answered on 07 Jul 2016, 04:30 AM

Sure

 

0
M
Top achievements
Rank 1
answered on 08 Jul 2016, 11:16 AM

Hi Rosen  I have made one dummy POC using HTML Table but I need in Kendo Grid 

Please follow the link

 

https://jsbin.com/pegibozewo/1/edit?html,js,output

 

 

0
Rosen
Telerik team
answered on 11 Jul 2016, 06:34 AM

Hello M,

I'm afraid I do not see any of our widgets on the test page you have provided. Unfortunately, our support service covers only issues directly related to our product. Please provide sample which demonstrates the issue with our Grid widget discussed in this thread. 

Regards,
Rosen
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
M
Top achievements
Rank 1
answered on 12 Jul 2016, 06:28 AM

Hi Rosen ,

        I have made one dummy POC using Kendo Grid Table

Please follow the link

 

http://jsfiddle.net/QBESY/350/#

0
M
Top achievements
Rank 1
answered on 12 Jul 2016, 12:03 PM
Hi Rosen Make sure that codes should work in Internet Explorer
0
Rosen
Telerik team
answered on 13 Jul 2016, 06:46 AM

Hello M,

The sample you have provided is using too old version of Kendo UI library which does not support locked columns at all. Updating the sample to use a more recent version of the library and apply the suggestion approach does not yield any errors.

Regards,
Rosen
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
M
Top achievements
Rank 1
answered on 14 Jul 2016, 06:41 AM
Thankyou Rosen I have done according to your comments but after applying I am not getting the full row value that is of unlocked columns value that is according to your sample how can I get full row value and how I will know whether checkbox is checked or not I have to perform the other operation based on the selection of the checkbox
0
Rosen
Telerik team
answered on 15 Jul 2016, 06:06 AM

Hello M,

I'm not sure I understood your question. Could you please modify the test page from my previous reply in order to demonstrate the issue you are facing.

Regards,
Rosen
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
M
Top achievements
Rank 1
Answers by
M
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or