2012-09-12 30 views

回答

2

你可以做的是使用的colModeltemplate財產或jqGrid的的cmTemplate選項使用定義默認sorttype屬性網格的所有列。如果你想在$.jgrid.defaults設置cmTemplate選項,則更改默認sorttype財產所有網格的所有列:

$.extend($.jgrid.defaults, { 
    cmTemplate: { 
     sorttype: 'int' // you can use functions in the same way 
         // to define custom sorting 
         // see https://stackoverflow.com/a/5296935/315935 
         // for the code example 
    } 
}); 

the answer瞭解更多詳情。例如,如果你想自定義從the answer

+0

感謝奧列格,該訣竅排序類似的功能。 –

+0

@TheDavester:不客氣!我建議你使用'cmTemplate'和'template'。這些選項可以減少代碼並使其更具可讀性和更好的可管理性。 – Oleg

相關問題