EasyUI Forum

General Category => General Discussion => Topic started by: jsanchez on July 25, 2017, 02:19:24 PM



Title: Display documents in datagrid loaded with $ _FILES statement
Post by: jsanchez on July 25, 2017, 02:19:24 PM
Hello, I have a question with the datagrid. I need it on the screen of the datagrid when deploying a file loaded with $ _FILES I get the display of the file or document that loads to display it in a datagrid.

            <tr>
                <th data-options="field:'nombreConvenioFormRepositorio'" width="40%">Nombre del Convenio</th>
                <th data-options="field:'nombreTipoRepositorioFormRepositorio'" width="20%">Tipo Repositorio</th>
                <th data-options="field:'nombreFormRepositorio'" width="40%">Nombre del Repositorio</th>
               <th data-options="field:'documentoRepositorioFormRepositorio'" width="10%">Documento</th>                 
            </tr>

The variable "RepositoryFormRepository" is a path for viewing a file. What I need what instruction I need or what I should do.

thanks for your help


Title: Re: Display documents in datagrid loaded with $ _FILES statement
Post by: stworthy on July 25, 2017, 05:22:07 PM
Use the 'formatter' function to embed an <iframe> to display your file's content. Please try this code.
Code:
<th data-options="field:'documentoRepositorioFormRepositorio',width:250,
    formatter: function(value,row){
      var url = ...;
      var s = '<iframe src=\''+url+'\' style=\'width:100%;height:100px\'></iframe>';
      return s;
    }"> Documento </th>


Title: Re: Display documents in datagrid loaded with $ _FILES statement
Post by: jsanchez on July 27, 2017, 02:46:59 PM
Thank you