Threaded View

  1. #1
    Ext User
    Join Date
    Jul 2007
    Vote Rating
    xiexueze has a little shameless behaviour in the past


    Default [3.0]Ext.ux.tree.PagingTreeLoader

    HI,I rewrite the Ext.ux.tree.PagingTreeLoader to support the ext3.0 rc1

    this PagingTreeLoader has been tested in IE6/firefox3/chrome1/safari4

    PagingTreeLoader suports client paging and server paging:

    1.client paging uages:
    HTML Code:
    var tree = new Ext.tree.TreePanel({
        plugins: new Ext.ux.tree.TreeNodeMouseoverPlugin(),//must use the plugin 
        loader: new Ext.ux.tree.PagingTreeLoader({         //use the extend TreeLoader 
          pageSize:10,                                    //the count of the childnode to show every time,default 20
          enableTextPaging:true,                          //whether to show the pagination's text 
          pagingModel:'local'                             //local means client paging ,remote means server paging,default local
        root: new Ext.tree.AsyncTreeNode({ id:'0',text:'root' }) 
    the server just get the 'node' parameter value,and return the JSON like this:
    HTML Code:

    2.server paging uages:
    the js code just change the pagingModel value to 'remote'.
    the server will receive some parameters:
    node : the id of the node which is expending or paging
    start : the start index of the children,when the node first expends,the start value is 0
    limit : equals the jscode's pageSize,means the count of the node to show ervery time
    total : the total count of the node's children,when the node first expends,the total parameter dosen't exist.

    the server return the JSON like this:
    HTML Code:
    Attached Images
    Attached Files