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

Possible bug: loosing reference to datasource

2 Answers 92 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 13 Aug 2012, 06:23 PM
I'm not the most adept with Javascript or Kendo, so this may be a bug, or it might just be my noobism showing.

I have a Kendo Grid created from the MVC stuff in the fluent library.   It's named "DocumentsGrid". It works fine.  No complaints, until I created a Custom Command on the grid that executes a javascript function named showRevisions.

<div id="RevisionWindow"></div>
  
<script language="javascript">
    function showRevisions(e) {
        var documentId = 1234;
          
        var wnd = $("#RevisionWindow").kendoWindow({
            content: "somecrazyurl?documentId=" + documentId ,
            title: "Revisions for Document " + documentId,
            width: "750px",
            height: "480px",
            modal: true,
            actions: ["Close"]
        }).data("kendoWindow");
                  
        wnd.center().open();
    }
</script>

This all executes fine.   Unfortunately, however, sometime after this function has completed, any javascript that relies on $("#DocumentsGrid").data("kendoGrid").dataSource fails.  I debugged through the code and the exact line of code where $("#DocumentsGrid").data("kendoGrid").dataSource begins returning null is in the jquery.js library, approximately line  8324:

complete(status, statusText, responses, responseHeaders);

The consequence of this is that I'm unable to do any paging or advanced manipulation of data in javascript once the window has been opened because most of the attributes on the DocumentsGrid object don't appear to be there anymore. 

Is this a bug in jquery, kendo, or am I expected to reconstruct the grid every time I after I manipulate windows?

Thanks,

Jason

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 16 Aug 2012, 09:21 AM
Hi,

 This sounds similar to this problem. Please try the suggested solution.

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jason
Top achievements
Rank 1
answered on 16 Aug 2012, 05:52 PM
That is the solution that I was looking for.  Thanks Atanas!
Tags
Data Source
Asked by
Jason
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jason
Top achievements
Rank 1
Share this question
or