custar
unread,Aug 29, 2009, 1:28:52 AM8/29/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to CakePHP-ja
scriptaculous の IPE のオプションには htmlResponse が指定できることがソー
スから分かります (1)。
// controls.js
Object.extend(Ajax.InPlaceEditor, {
DefaultOptions: {
...
htmlResponse: true, .................................... (1)
options.htmlResponse 次第で、Ajax.Updater(), Ajax.Request() の使い分け
が行われます。
Ajax.InPlaceEditor = Class.create({
handleFormSubmission: function(e) {
...
if (this.options.htmlResponse) {
...
new Ajax.Updater(...);
}
else {
...
new Ajax.Request(...);
}
で、これを AjaxHelper で指定しようとすると、下記 $editorOptions に含ま
れていないため、出力されません。何で含まれなかったのか、ということは置
いといて、取り敢えず出力させるには、
// ajax.php
var $editorOptions = array(
'okText',
'cancelText',
'savingText',
'formId',
'externalControl',
'rows',
'cols',
'size',
'highlightcolor',
'highlightendcolor',
'savingClassName',
'formClassName',
'loadTextURL',
'loadingText',
'callback',
'ajaxOptions',
'clickToEditText',
'collection',
'okControl',
'cancelControl',
'submitOnBlur'
);
render 前にこの editorOptions に htmlResponse を追加するだけ。