We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

getCurrentViewData doesn't work in 14.1451.0.41 version

Hi,

I've this page:



And a javascript code in EditarButton for edit

var grid = $("#gridUsuarios").ejGrid("instance");
var index = this.element.closest("tr").index();           
var record = grid.getCurrentViewData()[index];
location.rel='nofollow' href = "AdministrarUsuario.aspx?ID=" + record.ID;

I've update syncfusion librario to 14.1451.0.41 version, and now the function getCurrentViewData doesn't work







8 Replies

JK Jayaprakash Kamaraj Syncfusion Team May 27, 2016 12:36 PM UTC

Hi Manolo, 

Thank you for contacting Syncfusion support. 

We have created a sample with 14.1.0.41 version. But we were unable to reproduce the issue at our end. 

Please share the following information to find the cause of the issue and provide a solution       
 
1.             Is there any script error or exception thrown in your project? If so, attach a screenshot of stack trace.   
2.             Issue replication procedure.   
3.             When you are facing the issue (while mouse click or touch the button)?  
4.             Check whether your grid id is correct or not.  
5.             Are you getting instance of grid?   
6.             Are you getting incorrect value in getCurrentViewData()?   
7.             Have you referred individual script file in your project?    
8.             An issue reproducing sample if possible or replicate the issue in the following sample.  
 

Regards, 

Jayaprakash K. 



MA Manolo May 30, 2016 10:10 AM UTC

Hi,

I attach an example


MA Manolo May 30, 2016 10:11 AM UTC

Sorry... the example _:)

Attachment: SyncfusionASPNETGrid_2ca06bb2.zip


JK Jayaprakash Kamaraj Syncfusion Team May 31, 2016 06:15 AM UTC

Hi Manolo, 

Since you have created grid instance with wrong grid id this issue has occurred. To overcome this problem, set ClientIDMode as Static in Grid or create instance using ClientID(var grid = $('#<%= Grid1.ClientID %>').data("ejGrid")). Please refer to the below code example and sample.   
 
<ej:Grid ID="Grid1" ClientIDMode="Static" AllowSorting="true" AllowPaging="True" 
            </ej:Grid> 

(or) 
 
        function onClick(args) { 
            var grid = $('#<%= Grid1.ClientID %>').data("ejGrid"); 
            var index = this.element.closest("tr").index(); 
            var record = grid.getCurrentViewData()[index]; 
 
            alert(record.OrderID) 
        } 


Regards, 

Jayaprakash K. 



MA Manolo May 31, 2016 06:31 AM UTC

OK, setting clientIdMode it works

But two questions:

1) Why in version 13.XXX.XX.XX it works fine?
2) I don't understarnd the error... can you explain me?
3) What does the property "ClientIdMode?

Thanks a lot


JK Jayaprakash Kamaraj Syncfusion Team June 1, 2016 01:35 PM UTC

Hi Manolo, 

Query1: Why in version 13.XXX.XX.XX it works fine? 
 
We are facing the same problem(without using ClientIDMode) older version also. 
 
Query 2 & 3:  I don't understand the error... can you explain me? What does the property "ClientIdMode? 

In ASP.NET , If you set ClientIDMode as static the grid id will be generated by given value(<ej:Grid ID="Grid1">) else Grid id will be generated  by concatenating given grid id and parent container id( eg: MainContent_Grid1). Because default value of ClientIDMode is AutoID. So, while creating grid instance with wrong id we will get the error in Grid. Please refer to the following screenshots. 

Before using ClientIDMode: 

 


After using ClientIDMode: 

 


 Please refer to the below link. 


Regards, 

Jayaprakash K. 



MA Manolo June 1, 2016 02:46 PM UTC

Ok,!

Thanks a lot


JK Jayaprakash Kamaraj Syncfusion Team June 2, 2016 04:49 AM UTC

Hi Manolo,    
 
Thanks for the update. 
 
Get back to us if you need any further assistance. 
 
Regards,   
 
Jayaprakash K. 


Loader.
Live Chat Icon For mobile
Up arrow icon