我有一个数据表,用户可以通过它分页并选择要显示的记录。该记录通过 Ajax 调用将整个数据表替换为另一个数据表。在第二个
数据表是一个按钮,允许您返回到第一个.. 目前,当您这样做时,您将返回到第一个表的开头.. 我想要做的是存储第一个数据表的状态(当前页面,偏移量, Max Records ..)选择记录时,我可以在回到记录时将其恢复。.实际上存储信息并不是什么问题 - 这是如何重新申请它.??
我环顾四周,发现了一些代码..
YAHOO.util.Event.onDOMReady(function(e) {
var offset = new YAHOO.util.Element('offset').get('value');
var max = new YAHOO.util.Element('max').get('value');
var state = GRAILSUI.receiptBatchList.getState();
state.sorting = state.sortedBy;
state.pagination.recordOffset = offset;
state.paginator.rowsPerPage = max;
var query = GRAILSUI.receiptBatchList.buildQueryString(state);
GRAILSUI.receiptBatchList.getDataSource().sendRequest(query,{
success : GRAILSUI.receiptBatchList.onDataReturnReplaceRows,
failure : GRAILSUI.receiptBatchList.onDataReturnReplaceRows,
scope : GRAILSUI.receiptBatchList,
argument: state
});
其中 offset 和 max 只是页面上的隐藏值,但我无法让它工作,我真的希望它能够相当快地实现..
有什么建议么 ?
蒂亚..