Hi,
First time in this forum….The situation is.. I want to dynamically insert value in the textbox once value is selected/changed in combobox. How can I do this ? I am quite new to JQGrid…
$(document).ready(function(){
$(“#datagrid”).jqGrid({
url:'actionpo.php?vid=polpogridjq',
datatype: 'xml',
mtype: 'GET',
colNames:['List#','PO#', 'Item Code','Item Detail','Qty','Price','Tax'],
colModel :[
{name:'polistno', width:100,editable:true,editable:true,key:true},
{name:'polpono',index:'polpono', width:100,editable:true,key: false },
{name:'politemcode',index:'politemcode', width:100, align:'right',sortable:true,editable:true,edittype: “select”, editrules: { required: true }, editoptions: { size: 1,
dataUrl:'actionpo.php?vid=populatesel',
dataEvents :[
{ type: 'change', fn: function(e) {
var thisval = $(e.target).val();
$.get('actionpo.php?vid=getitemname&itemcode='+thisval, function(data)
{ var res = $(data).html();
alert (res)
$('#politemname').html(res);
}); // end get
}//end func
} // end type
] // dataevents
}//edit options
},
{name:'politemname',id:”L1″, width:300, align:'left',sortable:false,editable:true},
{name:'politemqty',width:50, align:'right',sortable:false,editable:true},
{name:'politemvalue', width:80,align:'left',sortable:false,editable:true},
{name:'politemtax', width:50, align:'right',editable:true}
],
pager: $('#pager'),
rowNum:10,
rowList:[10,20,30],
sortname: 'polpono',
sortorder: 'desc',
shrinkToFit: false,
rownumbers: false,
multiselect: false,
viewRecords: false,
clearAfterAdd:true,
caption: 'Itemised Quantity',
editurl: “actionpo.php?vid=gridformcall”,
}
).navGrid('#pager', { edit: true, add: true, del: true ,search:false, refresh:true},{
//Edit Options
},{ //Add Options
},{
//Delete Options
width: 350,
caption: 'Delete User',
msg: 'Are you sure you want to delete this User?nThis action is irreversable.' ,
onclickSubmit: function(rp_ge, postdata) {
rp_ge.url = “actionpo.php?vid=gridformcall&delpono=” +
$('#datagrid').getCell (postdata, 'polpono');
}
},
{} //Search options
);
});
The textbox is “politemname” and dropdown list is “politemcode”. combo list is working fine its just I am not able to assign value I receieve from “$.get('actionpo.php?vid=getitemname&itemcode='+thisval, function(data) ” to text box.
Also is there a way to get the ids of element(CSS i think) names from modal form in JQgrid ?
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top