在 Ajax.InPlaceEditor 中传递ID值

来源:互联网 发布:ubuntu 16.04 lts中文 编辑:程序博客网 时间:2024/04/29 10:50

此函数在 script.aculo.us 构架包的 controls.js 文件中。

首先,你先找到下面这句的位置:

Ajax.InPlaceEditor.prototype = {
    initialize: 
function(element, url, options) {

 把它修改为:

Ajax.InPlaceEditor.prototype = {
    initialize: 
function(id, element, url, options) {
        
this.id = id;

然后再查找下面的类:

  createEditField: function() {

在它后面加入下列代码:

    //editID By iSLee
      var editID = document.createElement("input");
      editID.obj 
= this;
      editID.type 
= "hidden";
      editID.name 
= "editID";
      editID.value 
= this.id;
      
this.editField = editID;
      
this.form.appendChild(this.editField);
    
//editID End

这样就可以在接收页用 Request.From[0] 来取得 ID 传过去的值了。

把它修改为:
原创粉丝点击