有什麼辦法可以防止默認的ajax請求?我將在java腳本中完成所有配置後再刷新網格,然後我開始請求,但不知何故,這個kendo網格在加載頁面時會自動請求數據。Kendo Grid防止默認請求
@(Html.Kendo().Grid<Data>()
.Name("grid")
.HtmlAttributes(new { Class = "acceleratorGrid" })
.TableHtmlAttributes(new { Class = "styled", cellpadding = "0", border = "0", margin = "0" })
.Events(e => e.Change("onChange"))
.DataSource(dataSource => dataSource // Configure the grid data source
.Ajax() // Specify that ajax binding is used
.Read(read => read.Action("Products_Read", "Home")) // Set the action method which will return the data in JSON format
)
.Columns(columns =>
{
columns.Bound(product => product.ProductID).Template(@<text></text>).ClientTemplate("<input type='checkbox' onclick='return false' name='checkedRecords' />");
columns.Bound(product => product.ProductName);
columns.Bound(product => product.UnitsInStock);
}
).Selectable(s => s.Mode(GridSelectionMode.Single))
)
嘗試將['autoBind'](http://docs.telerik.com/kendo-ui/api/web/grid#configuration-autoBind)設置爲'false' – OnaBai
@OnaBai嗯,我也看到了enableCustomBinding你知道嗎有什麼不同 ? – kosnkov