是否有插件或扩展,它允许使用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);
    });
};
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top