0
我有一個模態表單內的數據表,我需要在服務器端動態地加載它,我有一個輸入,我在那裏捕獲值並需要通過javascript發送它(或者與獲取它不同的其他方法從modelAttribute對象)加載表。來自數據表輸入的動態值url
這是數據表,我需要存儲在#idCProp
輸入
<table th:if="${entity.formulario == 'formPerson'}" class="table dataTable" dt:deferLoading="10" id="propDT" dt:reloadSelector="#reloadProponent" dt:table="true" dt:sortable="true" dt:displaylength="10" dt:dom='ftip' dt:url="@{/person/loadProponents/__${entity.id}__/ **VALUE FROM INPUT**}" dt:serverside="true">
<thead>
<tr>
<th dt:property="entity.id" dt:renderFunction="nameAndLastName">Persona</th>
<th dt:property="entity.id" dt:sortable="false" dt:renderFunction="getProposalPost">Cargo</th>
<th dt:property="entity.id" dt:sortable="false" dt:renderFunction="getProposalInstitution">Institución</th>
<th dt:property="sendMethod.name" dt:sortable="false">Método de envío</th>
<th class="operations" dt:sortable="false" dt:property="id" dt:renderFunction="idToUrlProp"></th>
</tr>
</thead>
</table>
<input type="hidden" id="idCProp"/>
的價值,這是控制器方法
@RequestMapping(value = "/person/loadProponents/{idPerson}/{idCandidature}", method = RequestMethod.GET)
public @ResponseBody DatatablesResponse<Proposal> loadProponents(@PathVariable("idPerson") Long idPerson,@PathVariable("idCandidature") String idCandidature,
@DatatablesParams DatatablesCriterias criterias, HttpServletRequest request) {
//Do some stuff...
}
如何發送idCandidature
變量?
也許@tduchateau可以幫助你... – Kratul
你試過嗎? – sanluck