Hi, I'm implementing an ajax datatable with inplace editor components.
<t:jquery.datatable class="datatable_ajax" t:inplace="true" t:add="options" t:id="datatableAjax" t:mode="true" t:rowIndex="indexBis" t:model="model" t:source="subjects" rowsPerPage="5" t:options="options" t:row="subject">
<p:nameCell>
<div t:id="subjectname" t:type="jquery/inPlaceEditor" t:options="editorParams" value="subject?.name" t:context="subject?.subjectid" />
</p:nameCell>
<p:yearCell><div t:id="subjectyear" t:type="jquery/inPlaceEditor" t:options="editorParams" value="subject?.year" t:context="subject?.subjectid"/></p:yearCell>
<p:titulationCell><div t:id="subjecttitulation" t:options="editorParams" t:type="jquery/inPlaceEditor" value="subject?.titulation" t:context="subject?.subjectid"/></p:titulationCell>
<p:optionsCell>
<div id="minioptions" ><span><t:actionlink t:id="deleteSubject" context="subject?.subjectid"><img src="${context:userpanellayout/images/delete-icon.png}"/></t:actionlink> <t:actionlink t:id="subjectDetail" context="subject?.subjectid"><img src="${context:userpanellayout/images/delete-icon.png}"/></t:actionlink></span></div>
</p:optionsCell>
</t:jquery.datatable>
In java class I've got getEditorParams to read InplaceEditor component options:
public JSONObject getEditorParams() {
JSONObject params=new JSONObject();
params.put("callback", new JSONLiteral("function(value,settings)" +"{ console.output('dddd'); }"));
return params;
}
If I try to load the web app, I've got the alert: "JSON data from the server could not be parsed"
So, I guess there is something wrong with the JSONLiteral... If I send String instead, callback function is not read so it can't be called....
Sorry for y English... Any help?
Thanks guys!