As a final - I found problem!
When I setting livetable options need to write not only "rezultPage"
parameter - by also and "className" parameter ...
My working variant:
=========
JSON page:
=========
{{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($discard = $row.put('no', "$foreach.count"))
#end
$jsontool.serialize($map)
{{/velocity}}
===========
Livetable page
===========
{{velocity}}
#set($columns = [ "no" , "wIndex" , "wAlias" ,
"wName" , "wTeam" ,
"wActive" , "doc.date" , "_actions" ])
#set($columnsProperties = {
"no" : { "type" : "text", "size" : 10,
"filterable" : true,
"sortable": true },
"wIndex" : { "type" : "text", "size" : 10,
"filterable" : true,
"sortable": true },
"wAlias" : { "type" : "text", "link" :
"view", "size" : 10,
"filterable" : true, "sortable": true },
"wName" : { "type" : "text", "link" :
"view", "size" : 10,
"filterable" : true, "sortable": true },
"wTeam" : { "type" : "text", "size" : 10,
"filterable" : true,
"sortable": true },
"wActive" : { "type" : "text", "size" : 10,
"filterable" : true,
"sortable": true },
"doc.date" : { "type" : "text", "size" :
"10", "filterable" : true,
"sortable": true },
"_actions" : { 'actions' : ['edit', 'delete'] }
})
#set($options = {
"className":"etvcPlanningsCode.wClass",
"resultPage" : "etvcPlanningsCode.wJSON",
"translationPrefix" : "w2.livetable.",
"tagCloud" : true,
"rowCount": 15,
"maxPages" : 10,
"selectedColumn" : "wIndex",
"defaultOrder" : "asc"
})
#livetable("w2" $columns $columnsProperties $options)
{{/velocity}}
--
View this message in context:
http://xwiki.475771.n2.nabble.com/Using-custom-JSON-in-a-livetable-tp758220…
Sent from the XWiki- Users mailing list archive at
Nabble.com.