EasyUI Forum
May 20, 2024, 08:08:58 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datagrid + filebox  (Read 8360 times)
rezzonico
Full Member
***
Posts: 184


View Profile
« on: December 01, 2016, 05:31:44 AM »

Hi all,

I am trying (without success) to add a "filebox" field to a datagrid.
Is it possible ?
Can someone point me to an example ?

Thanks
Miche
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 01, 2016, 05:02:19 PM »

If you are using the inline editing feature, please set the 'editor' property to 'filebox'.
Logged
rezzonico
Full Member
***
Posts: 184


View Profile
« Reply #2 on: December 02, 2016, 03:34:42 AM »

Thanks

Regards
Miche
Logged
rezzonico
Full Member
***
Posts: 184


View Profile
« Reply #3 on: December 07, 2016, 06:30:56 AM »

Hi all,

I have a datagrid with the field "Pdf".
The type of the field "Pdf" is "filebox".

I am adding the new lines with the following code:

Code:
var rows = $('#dg').datagrid('getChanges','inserted');
for (var i=0; i<rows.length; i++) {
   var row = rows[i];
   params['Pdf'] = ???????????????;
   $.post(url, params, function() {}, 'json');
}

My question is:
how can I reference the content of the field "Pdf" (the content of the file that I need to upload) ?


Thanks
Miche
« Last Edit: December 08, 2016, 10:16:37 AM by rezzonico » Logged
rezzonico
Full Member
***
Posts: 184


View Profile
« Reply #4 on: December 09, 2016, 01:09:37 AM »

Some more information ...

in my program I am able to upload the file content of an input field (class="easyui-filebox") with the code below.
The problem is how to use this code with a filebox field in a datagrid.

In other words:

if in case of an input field (class="easyui-filebox") the variable "f" is:
var f = $('#Pdf').next().find('.textbox-value');

what would it be in case the filebox is a field in a datagrid ?


Thanks for any help.
Miche

Code:
         var form_data = new FormData();
         var f = $('#Pdf').next().find('.textbox-value');
         file_data = f[0].files[0];
         form_data.append('Pdf', file_data);

         $.ajax({
            url: 'upload.cgi',
            data: form_data,
            ...
         });
« Last Edit: December 09, 2016, 02:21:32 AM by rezzonico » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!