Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: ??????????TreeNode???? ??????

  1. #1
    Ext User djodjo's Avatar
    Join Date
    Nov 2008
    Location
    Tokyo
    Posts
    16
    Vote Rating
    0
      0  

    Default ??????????TreeNode???? ??????

    TreeNode???????TreePanel?????????
    ??????????????????

    selected???????select????unselect??????????
    ?????????????????????????????????????????????????????????

    ----??????????

  2. #2
    Ext User djodjo's Avatar
    Join Date
    Nov 2008
    Location
    Tokyo
    Posts
    16
    Vote Rating
    0
      0  

    Default ????

    ??????

  3. #3
    Sencha - Support Team yuki's Avatar
    Join Date
    Jun 2007
    Location
    Chigasaki, Japan
    Posts
    273
    Vote Rating
    0
      0  

    Default ????????????????

    TreePanel?tpl?????

    Code:
    var el = tpl.getTreeEl();
    el.on('click',function(e,t){
      if(this.id == t.id){		
        tpl.getSelectionModel().clearSelections();
      }
    },el);
    ?????????????

    TreePanel?????Click??????????????????????TreePanel???????Element???????????????????????

    ?????????????????????????????????????????
    ?????????????????
    Ext Japan, LLC [Twitter: @extjapan]
    [Ext JS / Ext GWT????????][????????????][Ext JS???????????????]

  4. #4
    Ext User djodjo's Avatar
    Join Date
    Nov 2008
    Location
    Tokyo
    Posts
    16
    Vote Rating
    0
      0  

    Thumbs up

    ?????
    ????????el?????????????????


    ???????????????????

    >???????
    ????????????

  5. #5
    Ext User
    Join Date
    Jan 2009
    Posts
    79
    Vote Rating
    0
      0  

    Talking ??????????????

    ?????????????? Ext.ux.GridUnselector ???????????????
    ??????????????Ext.ux.TreeUnselector ???
    Yuki ??????? Plugin ????????????????

  6. #6
    Sencha - Support Team yuki's Avatar
    Join Date
    Jun 2007
    Location
    Chigasaki, Japan
    Posts
    273
    Vote Rating
    0
      0  

    Thumbs up ??????????????

    ???????????????Extend????????????????????????????????kiyoto01????Ext.ux.GridUnselector????????????????????????

    ?????????????Grid??Tree?????????????????????????????????????????????????????Ext.ux.GridUnselector??????????????

    ????????????????????????????????????
    Ext Japan, LLC [Twitter: @extjapan]
    [Ext JS / Ext GWT????????][????????????][Ext JS???????????????]

  7. #7
    Ext User djodjo's Avatar
    Join Date
    Nov 2008
    Location
    Tokyo
    Posts
    16
    Vote Rating
    0
      0  

    Default

    ??????yuki?????????????????plugin????????
    ???????????????????

    ????????????????????????????????
    unselect???????????????????

    ???????

    Code:
    Ext.ux.TreeUnselector = function(){
        
        this.init = function(tree){
            tree.on('render',function(tree){
            var el = tree.getTreeEl();
                el.on('click',function(e,t){
                    if(this.id == t.id){
                        tree.getSelectionModel().clearSelections();
                    }
                },el);
            })
            tree.on('beforeclick',function(node,event){
                if(node.isSelected()){
                    node.unselect();
                    return false;
                }
            })
        };    
    }
    ??2/17
    BLOG??????????????
    ?????????????
    http://djodjo.jp/archives/52
    --------------------------
    http://djodjo.jp

  8. #8
    Sencha - Support Team yuki's Avatar
    Join Date
    Jun 2007
    Location
    Chigasaki, Japan
    Posts
    273
    Vote Rating
    0
      0  

    Thumbs up

    ???????????????
    Ext Japan, LLC [Twitter: @extjapan]
    [Ext JS / Ext GWT????????][????????????][Ext JS???????????????]

  9. #9
    Ext User
    Join Date
    Jan 2009
    Posts
    79
    Vote Rating
    0
      0  

    Red face

    ???? ID ?????????????!
    ??????????????????????????????????? GridView ?????????????????
    ??????????????
    TreePanel ????????????? id ??????????

    ??????????????????????DelayedTask ?????(100ms???)click -> rowclick ??????????????????????????????????????????

    Code:
    Ext.ux.GridUnselector = function(cfg) {
      cfg = cfg || {};
      var grid, unselectTask;
    
      // private ?????????
      this.init = function(cmp) {
        grid = cmp;
    
        // ?????????????????????
        unselectTask = new Ext.util.DelayedTask(function() {
          var sm = grid.getSelectionModel();
          if (typeof sm.clearSelections == 'function') {
            sm.clearSelections();   // CellSelectionModel
          } else {
            sm.selectRows([]);      // RowSelectionModel
          }
        });
        grid.on({
          rowclick: function() { unselectTask.cancel(); },
          click:    function() { unselectTask.delay(100); }
          /*
          // ????????????????????????? off
          rowdblclick: function(grid, idx, e) {
            var rec = grid.getStore().getAt(idx);
            if (grid.getSelectionModel().isSelected(rec)) {
              unselectTask.delay(100);
            }
          }
          */
        });
      };
    };
    ?????????????????????????????????????
    ???????????

  10. #10
    Sencha - Support Team yuki's Avatar
    Join Date
    Jun 2007
    Location
    Chigasaki, Japan
    Posts
    273
    Vote Rating
    0
      0  

    Default

    djodjo???????????????????????????????????

    Ext.ux.TreeUnselector?????

    ?????????1?????????????????????????????????????????????????

    Wiki?????????????????????????????
    Ext Japan, LLC [Twitter: @extjapan]
    [Ext JS / Ext GWT????????][????????????][Ext JS???????????????]

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •