info-F3mW5S/pqWZeoWH0uzbU5w@public.gmane.org
2006-Apr-21 08:45 UTC
how-to pass other values to InPlaceCollectionEditor?
Hi, I am trying to pass others paramenter to the function InPlaceCollectionEditor, but I think that is not possible I have modified some rows controls.js to line 782 from: ####################### this.editField = this.cached_selectTag; if(this.options.loadTextURL) this.loadExternalText(); this.form.appendChild(this.editField); this.options.callback = function(form, value) { return "value=" + encodeURIComponent(value); } ####################### to: ####################### var extra_param = this.options.extra_param; //a.alonzi this.editField = this.cached_selectTag; if(this.options.loadTextURL) this.loadExternalText(); this.form.appendChild(this.editField); this.options.callback = function(form, value) { return extra_param + "value=" + encodeURIComponent(value);//a.alonzi } ####################### the code in order to use the function is: ###################################### var editor= new Ajax.InPlaceCollectionEditor(el, url, { ajaxOptions: {method: ''get''}, value: 0, collection: [[1,''aaa''],[2,''bbb''],[3,''ccc''],[0,''ddd'']], extra_param: ''op=tipo_cont&'', onBlur: function(request) {Element.show(''indicator'')} }); ###################################### According to you it is corrected? of it could insert this code of default for the next versions of controls.js? Antonello
info-F3mW5S/pqWZeoWH0uzbU5w@public.gmane.org
2006-Apr-24 07:10 UTC
Patch to InPlaceCollectionEditor
Hi, I am trying to pass others paramenter to the function InPlaceCollectionEditor, but I think that is not possible I have modified some rows controls.js to line 782 from: ####################### this.editField = this.cached_selectTag; if(this.options.loadTextURL) this.loadExternalText(); this.form.appendChild(this.editField); this.options.callback = function(form, value) { return "value=" + encodeURIComponent(value); } ####################### to: ####################### var extra_param = this.options.extra_param; //a.alonzi this.editField = this.cached_selectTag; if(this.options.loadTextURL) this.loadExternalText(); this.form.appendChild(this.editField); this.options.callback = function(form, value) { return extra_param + "value=" + encodeURIComponent(value);//a.alonzi } ####################### the code in order to use the function is: ###################################### var editor= new Ajax.InPlaceCollectionEditor(el, url, { ajaxOptions: {method: ''get''}, value: 0, collection: [[1,''aaa''],[2,''bbb''],[3,''ccc''],[0,''ddd'']], extra_param: ''op=tipo_cont&'', onBlur: function(request) {Element.show(''indicator'')} }); ###################################### According to you it is corrected? of it could insert this code of default for the next versions of controls.js? Antonello