0
我有越來越加載認爲點擊負載時的視圖進入人體,內容區域,如下圖所示單擊鏈接一次顯示網格,必須再次單擊鏈接才能在網格中顯示數據?
$('#manageusers').click(function() {
$('.body-content').load("../ManageLoginUsers/ManageUsers");
});
鏈接和腳本是這個
$(document).ready(function() {
ShowUserGrid(junkData);
});
// #region Junk Data
var junkData =
[{
"UserID": 1,
"LastName": "Smith",
"FirstName": "John",
"City": "Toronto",
"PostalCode": "N0K 1W0",
"Phone": "123-456-7890"
},
{
"UserID": 2,
"LastName": "Doe",
"FirstName": "Jane",
"City": "Seaforth",
"PostalCode": "A1A 1A1",
"Phone": "519-527-2897"
}];
// #endregion
// #region Users Grid
function LoadUserGrid() {
}
function ShowUserGrid(userdata) {
$("#UserGrid").kendoGrid({
noRecords: {
template: "No Records Available"
},
dataSource: {
data: userdata
},
columns: [
{ title: "<input id='checkAll', type='checkbox', class='check-box' />", template: "<input name='Selected' class='checkbox' type='checkbox'>", width: "30px" },
{ title: "UserID", field: "UserID", hidden: true },
{ field: "LastName", title: "Last Name" },
{ field: "FirstName", title: "First Name" },
{ field: "City", title: "City" },
{ field: "PostalCode", title: "PostalCode" },
{ field: "Phone", title: "Phone" }
],
scrollable: true,
height:700
});
}
// #endregion
現在,當視圖得到加載,我看到網格和它的空,所以然後我不得不再次點擊鏈接,數據被加載到網格中。
如何停止點擊鏈接兩次以獲取數據加載到網格?我也嘗試過使用按鈕,但同樣的事情,更好的是,爲什麼會發生這種情況?