1)JQGrid を使用しています。roa を編集してデータを投稿できますが、送信後にグリッドが読み込まれません。何かが足りないことはわかっていますが、何が何かわかりません。フォーラムとグーグルを見ましたが、結果はありません。以下は参照用のコードです。
$(document).ready(function() {
jQuery("#g-grid").jqGrid({
datatype: "json",
mtype: 'GET',
url: '${createLink(controller: 'response', action: 'listRequestsAsJSON')}',
colNames: ['Entry Type', 'Life Cycle Status','Start Date','End Date','Key Stakeholder Publish'
,'Remarks','RoadmapGroup','EventStatus'],
colModel: [
{name:'roadMapEntryTypeCode',index:'roadMapEntryTypeCode', editable:true,
edittype:"select",editoptions:{value:initdropdownlist('LIFECYCLE')}},
{name:'lifeCycleStatusCode',index:'lifeCycleStatusCode',editable:true,
edittype:"select",editoptions:{value:initdropdownlist('LIFECYCSTAT')}},
{name:'roadMapEventStartDate',index:'roadMapEventStartDate',editable:true,
formatter:'date',editoptions:{dataInit:datePick}},
{name:'roadMapEventEndDate',index:'roadMapEventEndDate',editable:true,
formatter:'date',editoptions:{dataInit:datePick}},
{name:'keyStakeholderPublisherCode',index:'keyStakeholderPublisherCode',editable:true,
edittype:"select",editoptions:{value:initdropdownlist('KEYSTAKEPUB')}},
{name:'roadMapEventRemarksText',index:'roadMapEventRemarksText',editable:true,
edittype:"textarea",editoptions:{rows:"2",cols:"20"}},
{name:'roadMapGroupName',index:'roadMapGroupName',editable:true
,editoptions:{size:10}},
{name:'roadMapEventStatusCode',index:'roadMapEventStatusCode',editable:true,
edittype:"select",editoptions:{value:initdropdownlist('EVENTSTAT')}}
],
pager: jQuery('#g-pager'),
ondblClickRow: function(rowid) {
jQuery(this).jqGrid('editGridRow', rowid,
{
closeAfterEdit:true,
afterSubmit: function(response,postdata){
var json=response.responseText;
var result=eval("("+json+")");
return [result.status,result.message];},
editCaption: "Edit LifeCycle Roadmap",
bSubmit: "Save",
bCancel: "Cancel",
bClose: "Close",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
reloadAfterSubmit:true
});},
viewrecords: true,
gridview: true,
editurl:'${createLink(controller: 'response', action: 'updateAssetLifecycleRoadmap')}'+"?AssetId="+${assetInstance?.id}
});
});
datePick = function(elem){jQuery(elem).datepicker({dateFormat:"mm/dd/yy"});};
$("#bedata").click(function(){
var gr = jQuery("#g-grid").jqGrid('getGridParam','selrow');
if( gr != null ) jQuery("#g-grid").jqGrid('editGridRow',gr,{height:280,reloadAfterSubmit:false});
else alert("Please Select Row");
});
initdropdownlist = function(colName) {
var options = ":";
$.ajax({
async: false,
type: "GET",
url: '${createLink(controller: 'response', action: 'getDropDownList')}?' + "sel=" + colName,
contentType: "application/json; charset=utf-8″,
dataType: "json",
success: function(dropDownListMap) {
for (var i = 0; i < dropDownListMap.option.length; i++) {
options +=";"+dropDownListMap.option[i].value + ":" +dropDownListMap.option[i].label;
}
}
});
return options;
}
2) もう 1 つは編集ボタンです。ボタンをクリックしてもアクションは実行されません。何か考えはありますか?
<input type="BUTTON" id="bedata" value="Edit Selected"/>