searchResultsGrid.uispin.html
2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<ui:group
let:keyProperties="{= app:getKeyProperties(?type) }"
let:pagerId="{= ui:uniqueId() }"
let:tableId="{= ui:uniqueId() }">
<table id="{= ?tableId }"/>
<div id="{= ?pagerId }" />
<script>
$("#{= ?tableId }").jqGrid({
<swon:NameValuePair arg:name="url" arg:value="getSearchResults?{= ?params }" />,
<swon:NameValuePair arg:name="datatype" arg:value="json" />,
colNames:[
<ui:if ui:condition="{= bound(?keyProperties) }">
<ui:forEach ui:resultSet="{#
SELECT ?colName
WHERE {
GRAPH ui:graph {
?keyProperties list:member ?keyProperty .
BIND (spif:titleCase(ui:label(?keyProperty)) AS ?colName) .
}
}
}" ui:separator=",">
'{= ?colName }'
</ui:forEach>
</ui:if>
<ui:else>
'Resource'
</ui:else>
],
colModel:[
<ui:if ui:condition="{= bound(?keyProperties) }">
<ui:forEach ui:resultSet="{#
SELECT ?varName
WHERE {
GRAPH ui:graph {
?keyProperties list:member ?property .
BIND (app:keyPropertyVarName(?property) AS ?varName) .
}
}
}" ui:separator=",">
{
<swon:NameValuePair arg:name="name" arg:value="{= ?varName }" />
}
</ui:forEach>
</ui:if>
<ui:else>
{
name : 'label',
width: 400
}
</ui:else>
],
<ui:if ui:condition="{= bound(?onSelect) }">
onSelectRow: function(resource) {
{= ?onSelect }
},
</ui:if>
autowidth: true,
height: 'auto',
rowNum: 10,
rowList:[5,10,20],
pager: '#{= ?pagerId }',
sortorder: 'asc',
viewrecords: true
}).jqGrid('navGrid', '#{= ?pagerId }', {
add:false,
del:false,
edit:false,
search: false
});
</script>
</ui:group>