Jqgrid:如何在编辑对话框窗口中获取Unformat单元格值

时间:2015-02-10 09:48:31

标签: jqgrid

我在Jqgrid中使用Handler完成了FileUpload。当我点击“添加”时,我可以浏览文件并能够上传值。

enter image description here

但是现在如果我想编辑相同的路径,当我点击“编辑”时,它不会带来已浏览的文件。

URL Value is empty

下面的

是colmodel:

{
    
   name: 'FormPath', index: 'FormPath', editable: true, width: 50, edittype: 'file',                                          
   editoptions: 
   {  
      enctype: "multipart/form-data"
   },
   formatter: function (cellvalue, options, rowObject)
   {
      return '<a href="' + cellvalue + '">' + rowObject.FormDisplayName + '</a>';
   },
   unformat: function (cellvalue, options, cell)
   {
       return $('a', cell).attr('href');
   }
}

下面是我在Form_edit对话框中调用的beforeshowForm事件。其他控件绑定正确的数据。但是 FormPath 不是。

beforeShowForm: function (form) 
{
    $("#FormError").remove();
    $("#tr_FormDisplayName", form).show();
    $("#tr_FormPath", form).show();
    $('#tr_FormDesc', form).show();
    $('#tr_SecurityTag', form).show();
}

任何人都知道如何在jqgrid的编辑对话框中将未格式化的值填充到单元格中。

提前致谢。

1 个答案:

答案 0 :(得分:0)

在我看来,你想填写

的输入值
<input type="file" ... />

但由于安全原因,我不可能(根据我的信息)。例如,请参阅the answer

顺便说一句,jqGrid没有任何内置的文件上传支持。所以你必须使用一些额外的插件(类似Plupload)或编写相对较长的代码。无论如何,您将无法使用输入数据“预填充”<input type="file"/>

相关问题