是否有插件或扩展,允许使用DWR远程调用的YUI数据源?
-
06-09-2019 - |
题
是否有插件或扩展,它允许使用DWR远程调用作为YUI数据源?
解决方案
没有插件做到这一点。 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);
});
};
不隶属于 StackOverflow