是否有允许将 DWR 远程调用用作 YUI 数据源的插件或扩展?
andy
问问题
260 次
1 回答
0
没有插件可以做到这一点。DwrYuiDataSource 目前支持远程方法的形式
public ReturnType methodName(String query)
但可以很容易地扩展到采用 beforeArgs 和 afterArgs 以便它支持
public ReturnType methodName(Object beforeArg1, Object beforeArg2,
String query, Object afterArg1, Object afterArg2)
javascript: DwrYuiDataSource
mypackage.DwrYuiDataSource = function(remoteMethod) {
this.remoteMethod = remoteMethod;
this._init();
};
mypackage.DwrYuiDataSource.prototype = new YAHOO.widget.DataSource();
mypackage.DwrYuiDataSource.prototype.doQuery = function(oCallbackFn,
sQuery, oParent) {
var oSelf = this;
this.remoteMethod(sQuery, function(aResults) {
var resultObj = {};
resultObj.query = decodeURIComponent(sQuery);
resultObj.results = aResults;
oSelf._addCacheElem(resultObj);
oSelf.getResultsEvent.fire(oSelf, oParent, sQuery, aResults);
oCallbackFn(sQuery, aResults, oParent);
});
};
于 2009-02-25T07:21:10.143 回答