0
任何人都可以建議我如何在子網格的自定義驗證功能中獲取父行ID?jqGrid:在子網格的自定義驗證功能中獲取父行號
這是我的代碼
subGrid: true,
subGridRowExpanded: function (subgrid_id, row_id)
{
var subgrid_table_id;
subgrid_table_id = subgrid_id+"_t";
var subgrid_pager_id = subgrid_id+"_p";
jQuery("#"+subgrid_id).html("<table id="+subgrid_table_id+" class=scroll></table><div id="+subgrid_pager_id+" ></div>");
jQuery("#"+subgrid_table_id).jqGrid(
{
url:"form_subgrid_ajax_296.php?id="+row_id+"&child_form_id=296",
editurl:"../ajax/common_subgrid_edit_296.php?form_id="+sub_grid_id+"&parent_id="+row_id,
datatype: "json",
colNames: ['ID','PESO'],
colModel: [{name:'id',index:'id',editable:false,hidden:true},
{name:'peso',
index:'peso',
formoptions:{elmsuffix:''},editrules:{required:true,custom:true, custom_func:customNumberChk},editable:true,
hidden:false,
search:true,
editoptions: {size:80, maxlength: 1000}
}],
sortorder: "asc",
height: 300,
loadonce: false,
width: 500,
rowNum:10,
rowList:[10,20,50],
sortname: 'id',
sortorder: "asc",
cellEdit: false,
cellsubmit: "clientarray",
caption:"Child",
pager: subgrid_pager_id
});
jQuery("#"+subgrid_table_id).jqGrid
(
"navGrid",
"#"+subgrid_pager_id,
{
edit:true,
add:true,
del:true,
search:false
},
{
width:780,
recreateForm:true
},
{
width:780,
recreateForm:true
}
);
}
現在看名稱: '比索',指數: '比索',。我使用了自定義的功能customNumberChk。
這是我的自定義功能
function customNumberChk(value,colname)
{
}
我想在這個功能的rowid。
這你使用的那種子網格? [Subgrid as Grid](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:subgrid_as_grid)? – Oleg
是的,我使用的次網格作爲網格 – Napster
的情況下,你有ROWID爲'subGridRowExpanded'回調的參數,我不完全明白你的問題。問題可能存在於你組織代碼的形式中。你應該包括你當前使用的代碼。 – Oleg