Я новичок в Jqgrid. Как загрузить изображение или файл в определенную папку.
я пытаюсь большую часть кода, но не понимаю, как использовать
Поэтому, пожалуйста, помогите мне
{
name: 'attachment',
index: 'attachment',
align: 'left',
editable: true,
edittype: 'file',
editoptions: {
enctype: "multipart/form-data"},
width: 210,
align: 'center',
search: false
},
{name:'remarks',index:'remarks', width:250, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"50"}}
],
viewrecords : true,
rowNum:10,
rowList:[10,20,30],
pager : pager_selector,
altRows: true,
//toppager: true,
multiselect: true,
//multikey: "ctrlKey",
multiboxonly: true,
loadComplete : function() {
var table = this;
setTimeout(function(){
styleCheckbox(table);
updateActionIcons(table);
updatePagerIcons(table);
enableTooltips(table);}, 0);},//editurl: "<? php cust_edit.php ?>",//nothing is saved
//editurl: "<?php cust_edit.php ?>",
editurl: "./call_logs_edit.php",//nothing is saved
caption: "Call Logs",
edit:true,
add:true,
del:true,
multipleSearch:true,
multipleGroup:true,
//refresh: false,
showQuery: true
//reloadAfterSubmit: true
//loadonce: false
//,autowidth: true,/**
,
grouping:true,
groupingView : {
groupField : ['name'],
groupDataSorted : true,
plusicon : 'fa fa-chevron-down bigger-110',
minusicon : 'fa fa-chevron-up bigger-110'
},
caption: "Grouping"*/
});
$(window).triggerHandler('resize.jqGrid');//trigger window resize to make the grid get the correct size//enable search/filter toolbar
//jQuery(grid_selector).jqGrid('filterToolbar',{defaultSearch:true,stringResult:true})
//jQuery(grid_selector).filterToolbar({});
/*
//switch element when editing inline
function aceSwitch( cellvalue, options, cell ) {
setTimeout(function(){
$(cell) .find('input[type=checkbox]')
.addClass('ace ace-switch ace-switch-5')
.after('<span class="lbl"></span>');
}, 0);
}*/
//enable datepicker
function pickDate( cellvalue, options, cell ) {
setTimeout(function(){
$(cell) .find('input[type=text]')
.datepicker({format:'yyyy-mm-dd' , autoclose:true});
}, 0);
}
//navButtons
jQuery(grid_selector).jqGrid('navGrid',pager_selector,
{ //navbar options
edit: false,
editicon : 'ace-icon fa fa-pencil blue',
add: true,
addicon : 'ace-icon fa fa-plus-circle purple',
del: true,
delicon : 'ace-icon fa fa-trash-o red',
search: true,
searchicon : 'ace-icon fa fa-search orange',
refresh: false,
refreshicon : 'ace-icon fa fa-refresh green',
view: true,
viewicon : 'ace-icon fa fa-search-plus grey',
},
{
//edit record form
//closeAfterEdit: true,
//width: 700,
closeAfterEdit: true,
reloadAfterSubmit : false,
recreateForm: true,
beforeShowForm : function(e) {
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
style_edit2_form(form);
}
},
{
//new record form // Add New Record in Add Form
width: 500,
closeAfterAdd: true,
recreateForm: true,
viewPagerButtons: false,
reloadAfterSubmit : false,
beforeShowForm : function(e) {
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar')
.wrapInner('<div class="widget-header" />')
style_edit_form(form);
}
},
{
//delete record form
recreateForm: true,
reloadAfterSubmit : false,
beforeShowForm : function(e) {
var form = $(e[0]);
if(form.data('styled')) return false;
form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
style_delete_form(form);
form.data('styled', true);
},
onClick : function(e) {
//alert(1);
}
},
Задача ещё не решена.
Других решений пока нет …