Home > Back-end > Javaweb realization click view of a table with another plate data update of the page
Javaweb realization click view of a table with another plate data update of the page
Time:09-15
Like the following picture like that, I want to by clicking on the view on the right, then left to check out some of the information, and each click next personal data will be more a change or update, should how to realize this? Give us a hand, every comment, ~
CodePudding user response:
The unique value as a parameter when click query query to the left to display the contents of the data, 1. The entire page to reload, query list on the right data, normally in the method to determine whether to have the unique value, any query through the only value left content, 2. Do partial refresh
CodePudding user response:
With ajax docking with the backend interface, use jquery or js can achieve, Ajax access to user data, display the list on the right page, check the button binding user ID, click the ajax after according to the user ID for details data, each click different users will be displayed to the user's information and to the page,
<script> The function getDataList () { $. Ajax ({ Type: "GET", Url:/getUserList,//get the user list interface DataType: "json", Success: the function (res) { Var htmlStr=""; Var list=res. The context;//return data If (a list!=null & amp; & The list!="" & amp; & The list! Undefined)={ For (var I=0; i Var mydata=https://bbs.csdn.net/topics/list [I]; Var id=mydata (" id "); Var uname=mydata [" uname "]; Var sex=mydata (" sex "); Var cardNo=mydata (" cardNo "); Var...
}, Error: function (XMLHttpRequest, textStatus errorThrown) { The console. The log (" Error "); } }); } /* * * according to the user ID, click view, according to user information * @ param id * @ returns */ The function onViewInfo (id) { Var data_param=[]; Data_param (" id ")=id; $. Ajax ({ Type: "GET", Url:/getUserInfo,//get the user information interface Data: to pass an argument data_param,// DataType: "json", Success: the function (res) { Var mydata=https://bbs.csdn.net/topics/res.context;//return data If (mydata!=null & amp; & Mydata! Undefined)={ Var uname=mydata [" uname "]; Var headImg=mydata [" headImg "]; Var cardNo=mydata (" cardNo "); Var...