I'm working with portlets and spring MVC. I want to get a list of items with an ajax call and use that list as the display:table attribute.
I use this ajax call:
jQuery.ajax({ url:'<portlet:resourceURL id="recuperarDatosAF">
</portlet:resourceURL>', data: {idExpediente:expediente}, type: 'POST',
datatype:'json', success: function(data) {
alert(data);
}
This call is executed each time the user selects an item of a combo. the list of items that will be different each time recovered.
My question is: How could generate displaytable with that list I just get?
There a way to update a display: table defined in the jsp with that list?
The display that I have defined, retrieves the list of requestScope but I want to retrieve the list with ajax call.
My display:table:
<display:table id="docentes" name="${requestScope.docentesList}"
htmlId="resultadosDocentesListTable"
pagesize="4"
class="displayTagTable"
uid="docente">
http://jsfiddle.net/kVdZG/
Script to generate a table from json data, replace alert(data) with this code, here data.scores is my data
My question is: How could generate displaytable with that list I just get?
From my experience, your list must contains Map of json data eg:
The pList is contains Map of product.
There is a way to update a display: table defined in the jsp with that list?
Yup, after I check the display table tag part using firebug, I have found out that the display table tag will be change to normal html table. So in ajax:
and your display tag: