ExtJS4 행 알림 추가

1447 단어
userGrid.on("itemmouseenter", function(view, record, item, index, e, eOpts ){
        var pos = view.getPositionByEvent(e);
        var tip = Ext.create('Ext.tip.ToolTip', {
            // The overall target element.
            target: view.el,
            // Each grid row causes its own separate show and hide.
            delegate: view.itemSelector,
            // Moving within the row should not hide the tip.
            trackMouse: true,
            // Render immediately so that tip.body can be referenced prior to the first show.
            renderTo: Ext.getBody(),
            listeners: {
                // Change content dynamically depending on which element triggered the show.
                beforeshow: function updateTipBody(tip) {
                    var record = view.getRecord(tip.triggerElement);
                    var user_name = record.get("user_name");
                    var job_name = record.get("job_name");
                    var is_leader = record.get("is_leader");
                    var message = ' :' + user_name + '<br> :' + job_name;
                    if(is_leader && is_leader == 1) {
                        message = "<font color='red'> , !</font>";
                    }
                    tip.update(message);
                }
            }
        });
    });

좋은 웹페이지 즐겨찾기