Index: lams_central/web/qb/collection.jsp
===================================================================
diff -u -r80ab947256f1314103a88c68432755741615271b -r289d71a2af5137360ca926e9b03ca4bfccc4fe86
--- lams_central/web/qb/collection.jsp (.../collection.jsp) (revision 80ab947256f1314103a88c68432755741615271b)
+++ lams_central/web/qb/collection.jsp (.../collection.jsp) (revision 289d71a2af5137360ca926e9b03ca4bfccc4fe86)
@@ -108,7 +108,8 @@
"questionType",
"questionVersion",
"Used in
lessons",
- "Actions"
+ "Actions",
+ "hasVersions"
],
colModel:[
{name:'id', index:'uid', sortable:true, hidden:false, width: 10},
@@ -117,7 +118,8 @@
{name:'questionVersion', index:'questionVersion', width:0, hidden: true},
{name: 'usage', index: 'usage', sortable:false, width: 10, align: "center"},
// formatter gets just question uid and creates a button
- {name:'actions', index:'actions', classes: "stats-cell", sortable:false, width: 13, align: "center", formatter: actionsFormatter}
+ {name:'actions', index:'actions', classes: "stats-cell", sortable:false, width: 13, align: "center", formatter: actionsFormatter},
+ {name:'hasVersions', index:'hasVersions', width:0, hidden: true}
],
beforeSelectRow: function(rowid, e) {
// do not select rows at all
@@ -130,7 +132,52 @@
loadError: function(xhr,st,err) {
collectionGrid.clearGridData();
alert("Error!");
- }
+ },
+ subGrid : true,
+ subGridOptions: {
+ hasSubgrid: function (options) {
+ return options.data.hasVersions == 'true';
+ }
+ },
+ subGridRowExpanded: function(subgrid_id, row_id) {
+ var subgrid_table_id = subgrid_id + "_t",
+ rowData = jQuery("#" + subgrid_id.substring(0, subgrid_id.lastIndexOf('_'))).getRowData(row_id),
+ questionId = rowData["id"].split("_")[0];
+ jQuery("#"+subgrid_id).html("