Forum



00:13

13/07/2011

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 ?
Aamir
Most Users Ever Online: 715
Currently Online:
49 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