Inline editor - Ext JS

The inline editor that's used to for example edit tree text nodes does not scroll when the container of the element it is editing scrolls. I seem to remember there's a neat, Ext way of fixing this, but it eludes me right now...
Reply With Quote
  # 2  
Old 03-08-2007, 07:38 AM
Default

It could be rendered to the tree panels body so it scrolls with the node. The problem with that is it can get clipped.

It could also use an interval to validate it's position while in edit mode... would be delayed though.
Reply With Quote
  # 3  
Old 03-08-2007, 10:17 AM
Default

I would expect the scroll event to end the edit session on the field, much like clicking on a page would close a menu.

my $.02
Reply With Quote
  # 4  
Old 03-08-2007, 05:27 PM
Default

simeon, I agree 100%. The problem is that scroll events don't bubble so there's no way I can generically attach and hide the editor. Maybe a code example in the download (it would be very short) showing how to wire it to the tree's scroll would make sense.
Reply With Quote
  # 5  
Old 03-09-2007, 09:22 AM
Default

If there is an ext equivalent to IE's onpropertychange event(custom event?). I would use a property on the scrolling container and attach a listener to that property.

<div οnscrοll="this.isScrolling = this.isScrolling*-1" isScrolling="1">

    <div>floating stuff here</div>
    <div>floating stuff here</div>

</div>
Then when I create a floating element (menu, edit form field, etc.), I would attach an onpropertychange event listener to the scrolling div. I would listen for a change to the isScrolling property which will be cycling between 1 and -1 as the container scrolls. If that listener is called then the floating elements will close themselves independently.

This could be accomplished implicitly when the floating elements are created by looping up through the dom looking to see if the containing elements have an isScrolling attribute. If it does, then the floating element could attach an event listener to its isScrolling attribute.

As for getting a working example, i would need to work on that next week. I have to have my prototype ready for a QA sneak peak on monday. :-)
Reply With Quote
  # 6  
Old 03-09-2007, 05:15 PM
Default

It's pretty easy to wire it up:

tree.getEl().on('scroll', function(){
    if(editor.editing){
        editor.cancelEdit();
    }
});
It will do the editing check internally in the next build.
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值