情况是我想在组合框中选择/更改值后在文本框中动态插入值。
我该怎么做?我对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
);
});
文本框是“politemname”,下拉列表是“politemcode”。组合列表工作正常它只是我无法分配值我从下面的代码接收到文本框。
$.get('actionpo.php?vid=getitemname&itemcode='+thisval, function(data)
还有一种方法可以从JQgrid中的模态形式获取元素(CSS我认为)名称的ID吗?