【问题标题】:Updating RadAjaxPanel from jQuery从 jQuery 更新 RadAjaxPanel
【发布时间】:2015-01-05 22:17:04
【问题描述】:

我在 RadAjaxPanel 中有一个 RadGrid 控件。在我的 jquery 代码中,我发出 ajax 请求以向 RadGrid 添加新记录。它已成功添加。但是,即使我通过下面的代码更新 RadAjaxPanel,它也不会显示在页面上。

var panel = <%= ajaxPanel.ClientID %>;  
panel.ajaxRequest('<%= ajaxPanel.UniqueID %>',''); 

我看到 RadAjaxPanel 已更新,但没有新记录。我必须刷新整个页面才能显示新记录。有什么办法不刷新吗?

【问题讨论】:

    标签: jquery ajax telerik radgrid radajaxmanager


    【解决方案1】:

    可能需要为 RadGrid 调用 Rebind。

    我在页面上的 RadCodeBlock 中有一个 JavaScript 函数,我会在更新 RadAjaxPanel 之前调用它:

    function refreshGrid() {
        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
    }
    

    然后在后面的代码中:

    Protected Sub RadAjaxManager1_AjaxRequest(sender As Object, e As AjaxRequestEventArgs)
        Dim RadGrid1 As RadGrid = rgdPeople
    
        If e.Argument = "Rebind" Then
            RadGrid1.MasterTableView.SortExpressions.Clear()
            RadGrid1.MasterTableView.GroupByExpressions.Clear()
            RadGrid1.Rebind()
        End If
    End Sub
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-04-10
      • 1970-01-01
      • 1970-01-01
      • 2017-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多