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

[Solved] Calling Rebind Causes A Double POST

1 Answer 17 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.
Mike
Top achievements
Rank 1
Mike asked on 05 Jul 2011, 09:28 PM
Hi,

I'm working on getting ajax working with my grid for sorting and paging. I've written java script that makes a requests against one of my controller actions and updates the grid. The problem is when I look at whats happening behind the scene using Firebug I can see that after my java script runs the grid is making a second post to my action.

Here is my java script code.

$("#PurchaseGrid th").click(function() {
        var searchResults = $("#PurchaseGrid").data("tGrid");
        var searchParams = {
            VendorName: $("#VendorName").val()
        };
         
        searchResults.rebind(searchParams);
    });

When I step through the code I get one post back on searchResults.rebind(searchParams).

After the method exits is when I get the second unwanted post back.

Here is my view code

<% Html.Telerik().Grid<VendorPurchseSearchResult>(Model.SearchResults)
        .Name("PurchaseGrid")
        .Columns(c =>
            {
                c.Bound(column => column.First_Name).Title("First Name");
                c.Bound(column => column.Last_Name).Title("Last Name");
            })
        .Pageable(page =>
            {
                page.PageSize(20);
            })
        .Sortable()
        .DataBinding(d => d.Ajax().Select("ajaxSearch", "CustomerVendorPurchase"))
        .PrefixUrlParameters(false)
        .Render(); %>

Any ideas?

Thanks,
Mike

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 06 Jul 2011, 07:15 AM
Hello Mike,

 This is not a known issue and we couldn't reproduce it locally. Is there a chance to provide a sample project?

Kind regards,
Atanas Korchev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or