仅显示列表中的相关数据 [英] Only show related data in list table
本文介绍了仅显示列表中的相关数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用使用自动分页的表,当我从数据库获取数据时,它显示来自数据库的所有记录并使用列表显示在表中。如果记录是10,000,则需要时间。我想使用这样的技巧,不显示所有记录它只显示10条记录,当点击第2页时,它从数据库中获得11-20条记录。
怎么能可能,这种技术是否最好
我可以使用商店程序为此目的
< b>我尝试了什么:
i am using table that use auto paging, when i get data from database it show all record from DB and show in table using list. If record are 10,000 it take time. I want to use such trick that not show all record it just show 10 record and when click on page two it get 11-20 record from database.
How can it possible, and this technique is best or not
Can i use store procedure for this purpose
What I have tried:
function loadData() {
var Year = $("#year").val();
var Month = $("#month").val();
var DataObjectForAjaxCall = { strYear: Year, strMonth: Month };
if (Year != "" && Month != "") {
$("#modalCenter").click();
$.ajax({
url: "@Url.Action("loadData", "Home")",
method: "GET",
data: DataObjectForAjaxCall,
async: false,
success: function (Result) {
$('.modal-body').html(Result);
}
});
$("#hideLoader").click();
} else {
Alerts("Select Year and Month First");
}
}
推荐答案
(#year)。val ();
var Month =
("#year").val(); var Month =
(#month)。val();
var DataObjectForAjaxCall = {strYear:Year,strMonth:Month};
if(Year!=&& Month!=){
("#month").val(); var DataObjectForAjaxCall = { strYear: Year, strMonth: Month }; if (Year != "" && Month != "") {
(#modalCenter)。click();
("#modalCenter").click();
这篇关于仅显示列表中的相关数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文