私はjqgridを使用していますが、オプションが多すぎます。私がやりたいのは、事前定義されたオプションを設定し、後でそれを使用することです。
//my predefined options
var edit_options = {
editrules:
{
required:true
,edithidden:true
,editable:true
}
そして実行するとき
jGrid.jqGrid({
...
colNames:['id','Code', 'Name'],
colModel:[
//id
{name:'sample_id'
,index:'sample_id'
},
//Code
{name:'sample_code'
,index:'sample_code'
,edit_options
},
//Name
{name:'sample_name'
,index:'sample_name'
,edit_options
}
もちろん、ここでの「edit_options」はエラーになります。それを正しく行う方法は?2番目と3番目のオプションで事前定義されたオプションを使用したいだけです。$ .extend()を見ていますが、正しく理解できません。