2013-03-11 43 views
0

當頁面加載時,我必須顯示添加模式窗體。我這樣做正是如此:如何將navgrid選項添加到模態窗體?

$('#lst_totals').jqGrid('editGridRow','new'); 

問題是,我不知道如何設置navgrid當我把它用這種方式。我設置了添加模式窗體上的選項,這樣在navgrid:

// add options 
    { bSubmit: "Add", 
     width: 350, 
     recreateForm: true, 
     recreateFilter: true, 
     closeOnEscape: true, 
     closeAfterAdd: true, 
     editData: { action:'grdTotals' }, 
    }, 

但這些屬性未設置爲添加模式窗體我打電話時,頁面加載。它們只適用於添加添加按鈕被單擊時顯示的模式表單。如何將選項應用於從jqGrid外部調用的模態窗體?

回答

1

以下是解決方案。它是那樣簡單,因爲我知道這將是:

$('#lst_totals').jqGrid('editGridRow','new', 
    { bSubmit: "Add", 
     width: 350, 
     recreateForm: true, 
     recreateFilter: true, 
     closeOnEscape: true,     
     closeAfterAdd: true, 
     editData: { action:'grdTotals' }, 
    } 
); 

基本上,因爲我創造了新的模式窗體,這不是真正的navgrid的一部分,我得給它,我希望它有屬性。上面,'editGridRow'接受可以包含這些屬性的第三個參數{}。

相關問題