Create dynamicaly javascript

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Create dynamicaly javascript

yvan.dupre
hi

I use thymeleaf 3 and springboot

I use bootstrap table in a javascript inline.

 
$("#table").bootstrapTable({
     url: /*[[@{${url} }]]*/ genericUrl,
     queryParamsType: "",
     formatLoadingMessage: function () {
         return "";
     },
     responseHandler: function (res) {
         return {
             rows: res.content,
             total: res.totalElements,
             pageNumber: res.number,
             pageSize: res.size
         };
     },
     queryParams: function (params) {
             return{
                 userId: $("#searchuserid").val(),
		 userlastname: $("#searchuserlastname").val(),
                 page: params.pageNumber - 1,
                 size: params.pageSize,
                 sort: params.sortName + "," + params.sortOrder
             };
     }
 });

I search a way to generate part in bold dynamicaly

 return{
                 userId: $("#searchuserid").val(),
                 userlastname: $("#searchuserlastname").val(),

                 page: params.pageNumber - 1,
                 size: params.pageSize,
                 sort: params.sortName + "," + params.sortOrder
             };

On the server side, I pass a list of users.

How to loop on this list to genereate javascript variable and it's value?