2013-03-06 65 views
0

http://aloha-editor.org/guides/events.html#aloha-editable-created-event 頁面已經問題有關Aloha.trigger如何使用幾乎jQuery的Aloha的編輯器,Aloha.triger

Aloha.trigger('aloha-smart-content-changed', { 
    'editable'          : , // object of the editable 
    'keyIdentifier'     : , // char | null 
    'keyCode'           : , // char | null 
    'char'              : , // char | null 
    'triggerType'       : , // keypress, idle, blur, paste, block-change 
    'snapshotContent'   : , // snapshot content of the editable as HTML String 
}); 

Aloha.trigger('aloha-editable-created', [ 
    // jQuery object reference of an editable 
]); 

實際?我找不到任何例子。只有Aloha.bind可以發現

Aloha.bind('aloha-editable-created', function(jEvent, editable) { 
    console.log('editable "' + editable.getId() + '" created'); 
}); 

謝謝

回答

0

用一些這樣的事

Aloha.bind('aloha-smart-content-changed', function(jEvent, aEvent){ 
     // Get updated content 
    console.log(this, jEvent, aEvent.getSnapshotContent()); 
     // Get the object that is updated - jQ object 
    console.log($(aEvent.editable.obj).eq(0); 
});