<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    不做浮躁的人
    正在行走的人...
    posts - 171,  comments - 51,  trackbacks - 0

    我們接dojoTree Controller(1)繼續(xù)討論 TreeLoadingController
    1:該類在TreeBasicController基礎(chǔ)上增加了RPCUrl和RPCActionParam(默認(rèn)為action)兩個(gè)參數(shù)。解釋這兩個(gè)參數(shù)必須看下面的代碼:
    if (this.RPCUrl == "local") {
    ???var dir = document.location.href.substr(0, document.location.href.lastIndexOf('/'));
    ???var localUrl = dir+"/"+action;
    ???//dojo.debug(localUrl);
    ???return localUrl;
    ??}

    ??if (!this.RPCUrl) {
    ???dojo.raise("Empty RPCUrl: can't load");
    ??}

    ??return this.RPCUrl + ( this.RPCUrl.indexOf("?") > -1 ? "&" : "?") + this.RPCActionParam+"="+action;

    2:通用的錯(cuò)誤處理器:
    ??RPCErrorHandler: function(type, obj, evt) {
    ??alert( "RPC Error: " + (obj.message||"no message"));
    ?},
    可以自己定義處理方式。

    3:看以下runRPC的這段代碼,就能明白服務(wù)器端該怎么處理請(qǐng)求:
    dojo.io.bind({
    ???url: kw.url,
    ???/* I hitch to get this.loadOkHandler */
    ???handle: dojo.lang.hitch(this, handle),
    ???mimetype: "text/json",
    ???preventCache: true,
    ???sync: kw.sync,
    ???content: { data: dojo.json.serialize(kw.params) }?
    ??});
    4:loadRemote是動(dòng)態(tài)裝載該節(jié)點(diǎn)的子節(jié)點(diǎn)的方法,可以看看該方法的rpc部分:
    var params = {
    ???node: this.getInfo(node),
    ???tree: this.getInfo(node.tree)
    ??};
    dojo.io.bind({
    ???url: kw.url,
    ???/* I hitch to get this.loadOkHandler */
    ???handle: dojo.lang.hitch(this, handle),
    ???mimetype: "text/json",
    ???preventCache: true,
    ???sync: kw.sync,
    ???content: { data: dojo.json.serialize(kw.params) }
    ??});
    5:相對(duì)TreeBasicController,該Controller還重寫了doMove和doCreateChild方法。
    doMove: function(child, newParent, index) {
    ??/* load nodes into newParent in sync mode, if needed, first */
    ??if (newParent.isTreeNode && newParent.state == newParent.loadStates.UNCHECKED) {
    ???this.loadRemote(newParent, true);
    ??}

    ??return dojo.widget.TreeBasicController.prototype.doMove.apply(this, arguments);
    ?},
    可以看到是在同步處理完服務(wù)器的請(qǐng)求后,再執(zhí)行的客戶端操作。因此我們只要在服務(wù)器端處理添加新節(jié)點(diǎn)和移動(dòng)節(jié)點(diǎn)時(shí),只要返回true或false就可以了。

    posted on 2006-11-22 23:15 不做浮躁的人 閱讀(991) 評(píng)論(0)  編輯  收藏

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     

    <2006年11月>
    2930311234
    567891011
    12131415161718
    19202122232425
    262728293012
    3456789

    常用鏈接

    留言簿(9)

    隨筆分類(31)

    隨筆檔案(75)

    文章分類(1)

    文章檔案(3)

    搜索

    •  

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 亚洲大尺度无码专区尤物| 亚洲中文字幕无码爆乳| 毛片免费观看网站| 九九久久国产精品免费热6| 亚洲AV无码久久精品蜜桃| 成人午夜视频免费| 中文毛片无遮挡高清免费| 亚洲精品国产专区91在线| 国产美女做a免费视频软件| 国精产品一区一区三区免费视频 | 182tv免费观看在线视频 | 亚洲成人免费网站| 在线精品自拍亚洲第一区| 亚洲国产精品自在线一区二区| 成人一a毛片免费视频| 99久久99这里只有免费的精品| 在线综合亚洲中文精品| 亚洲一区二区三区在线播放| 青青在线久青草免费观看| 美女被免费网站91色| 亚洲欧美日韩国产成人| 亚洲AV色香蕉一区二区| 免费乱理伦在线播放| 国产免费女女脚奴视频网| a级成人毛片免费视频高清| 亚洲JIZZJIZZ妇女| 亚洲毛片无码专区亚洲乱| 最新国产AV无码专区亚洲 | 全免费a级毛片免费看无码| 99久久精品免费视频| 国产精品hd免费观看| 久久精品国产亚洲AV电影网| 亚洲欧洲免费视频| 在线日韩日本国产亚洲| 免费观看国产小粉嫩喷水| 丁香花在线观看免费观看 | 亚洲成A人片在线观看WWW| 亚洲国产成人精品91久久久| 午夜成年女人毛片免费观看| 亚洲免费在线视频观看| 免费一级毛片在线播放视频|