As by default the "colNames" property of the JQgrid displays the names that we harcode there like:
colNames: ['ProductID'], //columns model colModel: [ { name: 'ProductID', index: 'ProductID', align: 'left', search: true, stype: 'te开发者_Python百科xt', searchoptions: { sopt: ['eq', 'ne'] } }, ],
As here the "ProductID" in colnames property is harcoded here. Now my requirement is that this value should not be hard coded instead it should get the value from .resx file where we are maintaning the Translations.
Can we acheive this in jqgrid??
After reading of your question and thinking about all problems I made some minor changes in the localization files, made this and this demos and posted the feature request in the trirand forum. In the second demo I use less known column templates which was implemented in jqGrid based on one from my previous feature requests. The usage of templates can reduce and the length of JavaScript code used jqGrid and simplify it.
In your case you can probably simplify my demos and load all column headers (or lables of colModel
) and the grid title (the caption) from the resource file. You can choose the language based on headers of the HTTP requests (Accept-Language
) received from the client.
The exact implementation on the server side will be very depend on the technology which you use on the server.
精彩评论