我在我的項目中使用Jqgrid。爲了驗證目的,我已經在每列上定義了自定義函數。像,jqgrid自定義函數訪問其他字段值
{ label: 'Name', name: 'Name', width: 300,
editable:true, edittype:"custom", sortable:false,
editoptions:{custom_element: getDatabaseColumnSelector,
custom_value:getSelectedDatabaseColumn},
editrules:{required:true, custom:true, custom_func:somefunction}
},
在這裏,我要用於驗證目的somefunction(),在這個功能我用其他的列值也進行驗證。有些東西就像
if employeecountry = "US" then name.length < 10
但是在這個函數中,我怎麼能得到名稱列的自定義函數中employeecountry的值。我試着用
"# + rowId + _columnname"
但這不工作的情況下與附加的形式,因爲ROWID沒有設置在那個時候。如何在另一列中定義的自定義函數中獲得其他列值,這些列值將以編輯表單,內聯編輯和添加表單的方式工作。任何幫助都將非常可觀。