gpt4 book ai didi

javascript - 点击上传按钮上传文件后如何重新加载Jqgrid?

转载 作者:行者123 更新时间:2023-12-03 07:41:13 26 4
gpt4 key购买 nike

当我通过点击上传按钮上传文件时。它应该重新加载我的jqgrid并且新值应该位于网格的顶部,这是我的任务的一个场景。我需要在 Jquery 中进行哪些更改?我使用 loadonce = False 但它会连续加载网格。如果我重新加载整个页面,我就会在网格中获得值(value)。

_initUploadedFilesGrid: function(optionsM, resData){
$('table#viewUploadedFiles').trigger("reloadGrid");
$("#tmp").data('options', optionsM);
$('#viewUploadedFilesDiv table#viewUploadedFiles').cb({
datatype: 'json'
,mtype: 'POST'
,url: optionsM.urls.getAllUploadedFiles
, jsonReader : {
root:"UploadedFiles",
}
,colNames: [
'Vendor Id'
,'Import ID'
,'Imported Organization'
,'Source Authoring Tool'
,'Import Start Time'
,'Import Completed Time'
,'Status'
,'File Name'
,'File Type'
,'Content Area'
,'Course'
,'Band'
]
,colModel: [
{name: 'VendorId'}
,{name: 'ImportFileId'}
,{name: 'organizationId'}
,{name: 'sourceAuthoringTool'}
,{name: 'importStartTime'}
,{name: 'importCompletedTime'}
,{name: 'status'}
,{name: 'fileName'}
,{name: 'fileType'}
,{name: 'contentAreaId'}
,{name: 'CourseId'}
,{name: 'BandId'}
]
,columnchoosercaption: optionsM.msgs.chooseColumns
,height: 'auto'
,width: 1150
,pager: '#viewUploadedFilesGridPager'
,sortname: 'qImportFileId'
,sortorder: "desc",
//,loadonce: false,

onSelectRow: function(rowId, status){

var $grid = $('#viewUploadedFiles table[id=viewUploadedFiles]');
var row = $grid.getRowData(rowId);
$.cete.contentEditor._itemStatusDialog(row.ImportFileId);
},
});
$('#viewUploadedFiles table#viewUploadedFiles').jqGrid('setGridWidth', $('#gridviewUploadedFilesContainer').width());

},
$('input:radio[name=gradeType]').click(function() {
var selected = $('input:radio[name=gradeType]:checked').val();
if (selected=="Course") {
$('#BandSettingDiv').hide();
$('#CourseSettingDiv').show();
$('#CourseId option').eq(0).attr("selected",true);
$('#BandId option').eq(0).attr("selected",true);
}
else{
$('#BandSettingDiv').show();
$('#CourseSettingDiv').hide();
$('#CourseId option').eq(0).attr("selected",true);
$('#BandId option').eq(0).attr("selected",true);
}
});
me._initUploadedFilesGrid(options, "");

},

最佳答案

尝试更改此代码...你说,右边的对话框中有一个上传按钮。使用您的上传对话框 ID 而不是 $("#progressOfUpload") 和它肯定会起作用!

$('input:radio[name=BandType]').click(function() {
var selected = $('input:radio[name=BandType]:checked').val();
if (selected=="gradeCourse") {
$('#BandSettingDiv').hide();
$('#CourseSettingDiv').sh
$('#CourseId option').eq(0).attr("selected",true);
$('#BandId option').eq(0).attr("selected",true);
}
else{
$('#BandSettingDiv').show();
$('#CourseSettingDiv').hide();
$('#CourseId option').eq(0).attr("selected",true);
$('#BandId option').eq(0).attr("selected",true);
}
});
$("#progressOfUpload").off('dialogclose').on('dialogclose', function(event) {
$('table#viewUploadedFiles').jqGrid('GridUnload');
me._initUploadedFilesGrid(options, "");
});
me._initUploadedFilesGrid(options, "");

},

关于javascript - 点击上传按钮上传文件后如何重新加载Jqgrid?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35405172/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com