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

[Solved] Problems loading a grid from a Partial View

1 Answer 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paul
Top achievements
Rank 1
Paul asked on 30 May 2012, 09:33 PM
Hello everyone,

Been struggling with this one all day...

I have View containing 3 Telerik grids (all configured for Ajax binding and each rendered by a seperate partial view). The first two grids contain the 'main' data and are used to render the 3rd grid (the 1st and 3rd grid contains the same rows, and the rows from the 2nd grid are displayed as 'dynamic' columns in the 3rd grid - kind of a cross between the first two grids).

When one of the first two grids is modified, the 3rd grid is reloaded by making an ajax call to re-render the partial view.

Everything works fine when the View is initially loaded, however after the Ajax call to re-render the 3rd grid, the fields in the 3rd grid (rendered by Telerik as numerical/currency textboxes) can't be modified and I get the following JS error (in telerik.textbox.debug.js):

Line: 1551
Error: Unable to get value of the property 'value': object is null or undefined

telerik.textbox.debug.js
function evaluator(type) {
    return function (value) {
        $(this).data(type)
               .value(value);
    };
}

View
<div id="ManageLoanPurposeElements">
    @Html.Partial("_ManageLoanPurposeElements",Model)
</div>

JS
Here the OnComplete Event Handler of the second grid reloads the 3rd grid:
function onFinancingElementGridComplete(e) {
 
    // Update the Loan Purpose Grid
    if (e.name == "delete" || e.name == "insert") {
        $('#ManageLoanPurposeElements').load('./_ManageLoanPurposeElements');
    }
 
}

I have a feeling I'm having a similar problem to http://stackoverflow.com/questions/10726962/dynamically-loading-a-view-telerik-mvc


Paul

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 04 Jun 2012, 12:27 PM
Hello Paul,

I am not sure what exactly might throw that error. Could you provide more information how to reproduce the issue on our side? 
Also instead of reloading the whole partial view you could try to reload only the data of the Grid via the ajaxRequest() method.
e.g.
$('#ThirdGridName').data('tGrid').ajaxRequest()

All the best,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or