Created
January 27, 2009 18:33
-
-
Save rhyolight/53458 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var renderChildTable = function(parentId) { | |
GRAILSUI.childTable.customQueryString = 'id=' + myParentId; | |
var newState = { | |
startIndex: 0, | |
sorting: { // Sort values | |
key: 'id', // or whatever you want the default sort on | |
dir: YAHOO.widget.DataTable.CLASS_ASC | |
}, | |
pagination : { // Pagination values | |
recordOffset: 0, // Default to first page when sorting | |
rowsPerPage: GRAILSUI.childTable.get("paginator").getRowsPerPage() | |
} | |
}; | |
// Create callback object for the request | |
var oCallback = { | |
success: this.onDataReturnSetRows, | |
failure: this.onDataReturnSetRows, | |
scope: this, | |
argument: newState // Pass in new state as data payload for callback function to use | |
}; | |
// Send the request | |
GRAILSUI.childTable.getDataSource().sendRequest(GRAILSUI.childTable.buildQueryString(newState), oCallback); | |
}; | |
GRAILSUI.parentTable.subscribe('rowClickEvent', function(e) { | |
var selectedRows = this.getSelectedRows(); | |
var parentId = this.getRecord(selectedRows[0]).getData().id; | |
renderChildTable(parentId); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment