$ajax->editor に htmlResponse を指定できない

1 view
Skip to first unread message

custar

unread,
Aug 29, 2009, 1:28:52 AM8/29/09
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 を追加するだけ。
Reply all
Reply to author
Forward
0 new messages