我正在从 JSON 中检索数据,但整个数据都显示在我的页面上,但我想在页面上显示它,例如。第一页上的 1 到 10,当用户按下按钮时,会显示其余记录,我正在处理,但无法解决,Corona 中是否有任何分页的概念,或者请提供有关此方面的帮助问题,谢谢。。
这是我的json数据结构:
My code for displaying JSON data:
local test=json.decode(event.response)
local datas=test.data
for name, users in pairs(datas) do
for names, usernames in pairs(users ) do
for tag,value in pairs(usernames) do
cid=value.customerid
cname=value.customername
print(cname)
print(cid)
end
end
end
这是我的 json 数据,将按页面显示
{
"status":"success",
"data":{
"marks":[
{
"Marks":{
"first_name":"Amit",
"last_name":"Sharma",
"country_id":"20",
"Physics":"50",
"Chemistry":"35",
"Mathematics":"40"
}
},
{
"Marks":{
"first_name":"Amit",
"last_name":"Yadav",
"country_id":"21",
"Physics":"50",
"Chemistry":"35",
"Mathematics":"40"
}
},
{
"Marks":{
"first_name":"Pankaj",
"last_name":"Shukla",
"country_id":"22",
"Physics":"50",
"Chemistry":"35",
"Mathematics":"40"
}
},
{
"Marks":{
"first_name":"Abhishek",
"last_name":"Tiwari",
"country_id":"25",
"Physics":"50",
"Chemistry":"35",
"Mathematics":"40"
}
},
{
"Marks":{
"first_name":"Kashif",
"last_name":"Khan",
"country_id":"20",
"Physics":"50",
"Chemistry":"35",
"Mathematics":"40"
}
},
{
"Marks":{
"first_name":"Ankit",
"last_name":"Sharma",
"country_id":"19",
"Physics":"50",
"Chemistry":"35",
"Mathematics":"40"
}
},
{
"Marks":{
"first_name":"Rahul",
"last_name":"Vishwakarma",
"country_id":"27",
"Physics":"50",
"Chemistry":"35",
"Mathematics":"40"
}
},
{
"Marks":{
"first_name":"Amit",
"last_name":"Tiwari",
"country_id":"30",
"Physics":"50",
"Chemistry":"35",
"Mathematics":"40"
}
},
{
"Marks":{
"first_name":"Amit",
"last_name":"Sharma",
"country_id":"78",
"Physics":"50",
"Chemistry":"35",
"Mathematics":"40"
}
},
{
"Marks":{
"first_name":"Amit",
"last_name":"Sharma",
"country_id":"23",
"Physics":"50",
"Chemistry":"35",
"Mathematics":"40"
}
}
]
}
}