Skip to content

Instantly share code, notes, and snippets.

@rhyolight
Created February 5, 2009 18:28
Show Gist options
  • Save rhyolight/58899 to your computer and use it in GitHub Desktop.
Save rhyolight/58899 to your computer and use it in GitHub Desktop.
<gui:dataTable
id="${searchTableId}"
draggableColumns="true"
columnDefs="${columnDefinitions}"
controller="search" action="$action"
params="${searchURLParams}"
paginatorConfig="[
rowsPerPage: 10,
template : '{PreviousPageLink} {PageLinks} {NextPageLink} {CurrentPageReport}',
pageReportTemplate : '{totalRecords} total records'
]"
allowExclusiveSort='true'
sortedBy="${sBy}"
sortOrder="${sOrder}"
resultsList="displayDataList"
rowExpansion="false"
rowClickNavigation="false"
paginate="true"/>
<gui:dialog
id='drillDownDataDialog'
title='Data Drilldown'
autofillheight="body"
constraintoviewport='true'
>
<div id='drillDownData'></div>
</gui:dialog>
<script>
YAHOO.util.Event.onDOMReady(function() {
var populateDrillDown = function(url, fullViewUrl) {
var callback = {
success: function(o) {
GRAILSUI.util.replaceWithServerResponse(document.getElementById('drillDownData'), o);
GRAILSUI.drillDownDataDialog.show();
},
failure: {}
};
YAHOO.util.Connect.asyncRequest('POST', url, callback);
};
GRAILSUI.${searchTableId}.subscribe('rowClickEvent', function(e) {
var selectedRows = this.getSelectedRows();
var url = this.getRecord(selectedRows[0]).getData().dataUrl;
var fullViewUrl = this.getRecord(selectedRows[0]).getData().fullViewUrl;
populateDrillDown(url, fullViewUrl);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment