Forum


02:24

28/09/2012

1)I am using JQGrid I am able to edit the roa and post the data but the grid is not loading after submit.I know I am missing something but not sure what is.I looked the forum and google around but no result.Any help would be appriciated.Below is the code for your reference
$(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)The other thing is with the edit button,there is no action fired on clicking the button,any idea?
<input type="BUTTON" id="bedata" value="Edit Selected"/>
Most Users Ever Online: 715
Currently Online:
43 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66