我有一個Kendo網格,我試圖在選擇一行後測試javascript函數調用。Kendo grid - 調用javascript函數時出錯:「javascript運行時錯誤:'funcName'未定義」
<div id="datagrid">
@(Html.Kendo().Grid(Model)
.Name("datagrid_Concessoes")
.Columns(columns =>
{
columns.Bound(c => c.Id).Width(70);
columns.Bound(c => c.Code).Title("Código");
columns.Bound(c => c.Description).Title("Descrição");
columns.Bound(c => c.CreationDate).Title("Data de Criação");
columns.Bound(c => c.CreationUser).Title("Criado por");
})
.HtmlAttributes(new { style = "height: 534px;" })
.Scrollable()
.Sortable()
.Selectable()
.Events(e => e.Change("test"))
.Pageable(pageable => pageable
.Refresh(true)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(15)
.Read(read => read.Action("GetConcessoes", "MasterData"))
)
)
</div>
和JavaScript:
function test() {
alert("test");
}
我得到一個javascript runtime error: 'test' is undefined
只要電網即將被顯示。我試過行:
.Events(e => e.Change("test"))
.Events(e => e.Change("test()"))
,但沒有運氣
您正在使用哪個版本的kendo ui和jqeury? –
你可以嘗試在網格之前立即放置函數,看看會發生什麼?它可能只是該功能尚未定義 –
@ mo.esmp,''kendoUi'版本是最新的,'jquery'是1.7.1 – chiapa