Hello,
I have a edatagrid in which the field, when the user clicks on it, needs to have a window that pops up to that they can browse for a file on the local machine, and then when they press ok on the window, the path of the file is entered into the field thumbnailfilename. Can this be done with easyui functionality? If so what would the code look like? Thanks.
The html code:
<table id="videodg" title="Videos" style="width:700px;height:250px" toolbar="#videotoolbar" pagination="true" idfield="id"
rownumbers="true" fitcolumns="true" singleselect="true">
<thead>
<tr>
<th field="videoname" width="50" editor="{type:'validatebox',options:{required:true}}">Video Name</th>
<th field="videocode" width="50" editor="{type:'validatebox',options:{required:true}}">Video Code</th>
<th field="thumbnailfilename" width="50" class="easyui-validatebox" editor="{type:'file',options:{required:true}}">Thumbnail File Name</th>
</tr>
</thead>
</table>
<div id="videotoolbar">
<a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add" plain="true"
onclick="javascript:$('#videodg').edatagrid('addRow')">New</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-remove" plain="true"
onclick="javascript:$('#videodg').edatagrid('destroyRow')">Destroy</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-save" plain="true"
onclick="javascript:$('#videodg').edatagrid('saveRow')">Save</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-undo" plain="true"
onclick="javascript:$('#videodg').edatagrid('cancelRow')">Cancel</a></div>
<script type="text/javascript">
$(function(){
$('#videodg').edatagrid({
url: 'get_videos.php',
saveUrl: 'save_video.php',
updateUrl: 'update_video.php',
destroyUrl: 'destroy_video.php'
});
});
</script>