Reputation: 923
I have a doubt in Jqgrid. Can anyone tell me,is It possible to add options like 'shrinkToFit:false' or someother options dynamically in Jqgrid.
Can anyone tell how it can be done?
Thanks in advance
Upvotes: 3
Views: 6061
Reputation: 24125
If you look at jqGrid documentation, you will see that there is a column (last one) which is named Can be changed?. This column tells you if the option value can be set\changed after jqGrid initialization. This column in most cases takes one of following values:
Yes - the option value can be set\changed with setGridParam
method like this:
$('#gridId').jqGrid('setGridParam', { autoencode: true });
Yes. Requires reload - the option value can be set\changed with setGridParam
method but jqGrid needs to be reloaded in order to use new value. This can be achieved like this:
$('#gridId').jqGrid('setGridParam', { altRows: true }).trigger('reloadGrid');
I hope this explains the subject in general.
If it comes to shrinkToFit
options its value can't be set\changed after intialization - you would need to destroy the grid and built it again.
Upvotes: 7