[xwiki-users] Livetable filtering on a column added by custom json
Hello! I diving deeper and deeper in a livetables ... I created custom JSON page with this content: {{include document="XWiki.LiveTableResultsMacros" /}} {{velocity}} #if("$!{request.xpage}" == 'plain') $response.setContentType('application/json') #end #set($map = {}) #gridresult_buildJSON("$!request.classname" $request.collist.split(',') $map) #foreach($row in $map.get('rows')) #set($rowDoc = $xwiki.getDocument($row.get('doc_fullName'))) #set($parentDoc = $xwiki.getDocument($rowDoc.getParent())) #set($discard = $row.put('pNo', "$foreach.count")) #set($discard = $row.put('wDesc', " $parentDoc.getDisplayTitle() <$parentDoc.getExternalURL()> ")) #end $jsontool.serialize($map) {{/velocity}} As you can see, I added column with row number and column with link for the parent page. JSON working, livetable showing, but I cannot filter by these added columns ... any filter give empty result inside livetable. Maybe I wrote something wrong ... What need to do for normal working of filtering on a columns added by custom json? -- Thanks beforehand Eugen Colesnicov -- View this message in context: http://xwiki.475771.n2.nabble.com/Livetable-filtering-on-a-column-added-by-c... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Eugen, I think the default live table filtering is done on the database (see LiveTableResultsMacros), i.e. by adding constraints to the query that returns the data for the live table rows. If you want to filter custom columns that are not taken from the database then you need to write a custom filter. Hope this helps, Marius On Wed, Nov 7, 2012 at 7:33 PM, Eugen Colesnicov <ecolesnicov@gmail.com> wrote:
Hello!
I diving deeper and deeper in a livetables ...
I created custom JSON page with this content: {{include document="XWiki.LiveTableResultsMacros" /}}
{{velocity}} #if("$!{request.xpage}" == 'plain') $response.setContentType('application/json') #end #set($map = {}) #gridresult_buildJSON("$!request.classname" $request.collist.split(',') $map) #foreach($row in $map.get('rows')) #set($rowDoc = $xwiki.getDocument($row.get('doc_fullName'))) #set($parentDoc = $xwiki.getDocument($rowDoc.getParent()))
#set($discard = $row.put('pNo', "$foreach.count")) #set($discard = $row.put('wDesc', " $parentDoc.getDisplayTitle() <$parentDoc.getExternalURL()> ")) #end $jsontool.serialize($map) {{/velocity}}
As you can see, I added column with row number and column with link for the parent page. JSON working, livetable showing, but I cannot filter by these added columns ... any filter give empty result inside livetable. Maybe I wrote something wrong ...
What need to do for normal working of filtering on a columns added by custom json?
-- Thanks beforehand Eugen Colesnicov
-- View this message in context: http://xwiki.475771.n2.nabble.com/Livetable-filtering-on-a-column-added-by-c... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
Eugen Colesnicov -
Marius Dumitru Florea