1
的folloing选择选项是一个代码片段,我使用创建的jqGrid -jqGrid的填充根据以前选择
$("#list").jqGrid({
url:'products.php?storeId=<?php echo $_SESSION["valid_store"]; ?>',
datatype: 'xml',
mtype: 'GET',
colNames:['Product Id','Product Description','Department','Category','Price','Sale Price','Quantity','Extended Description','Image'],
colModel :[
{name:'ProductId', index:'ProductId', width:20},
{name:'product_name', index:'product_name', width:50, editable:true, edittype:'text', search:true, stype:'text'},
{name:'DepartmentName', index:'DepartmentName', width:40,sortable: false, editable: true, edittype: "select"},
{name:'CategoryName', index:'CategoryName', width:40,sortable:false, editable:true, edittype:'select'},
我使用下面填充了“DepartmentName的”动态当电网已加载 -
var departments = $.ajax({
url: "get_departments.php?storeId=<?php echo $_SESSION["valid_store"]; ?>",
async: false,
success:function(data, result){
if(!result){
alert("Failure to retrieve the Departments");
}
}
loadComplete:function(){
$("#list").setColProp('DepartmentName', { editoptions: { value: departments} });
},
Baslically我分配了大量的“部门”的成JSON格式,当电网已加载那么“DepartmentName的”填充了所有这些部门。这一切工作正常。
我在做/理解上有困难。现在我拥有这些值,具体取决于我从Select
中选择哪个“部门”,填入了仅由“部门”引用的“类别”的“类别名称”,数据之间的关系已经在MySQL
谢谢
我不明白的问题.... – jeschafe 2012-07-11 15:52:24
基本上,我怎么能填充“选择”根据我在前面做出的选择下拉菜单“选择”下拉菜单 – 2012-07-11 15:53:16