Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello Tony,
If one loads
colModel
from the server it's very practical to have properties which can be represented in JSON. If one want to usedataIni
or other callbacks (for jQuery UI Datepicker, select2 or other controls) one can't load such column definition via JSON. jqGrid contains already practical feature in formatters. Formatters allow to extent$.fn.fmatter
and assign string name to custom formatter and extend$.unformat
to register the corresponding unformatter. In the way one can easy extend the list of predefined formatters.jqGrid supports
template
property ofcolModel
starting from version 3.8.2, but the value have to be an object. I suggest to make small modification of the code to allow to use for exampletemplate: "number"
. To definenumber
template one need just define$.jgrid.cmTemplate.number
usingI think that such small change can makes long code which uses jqGrid more small and more easy to maintain.
The demo demonstrates the usage of jqGrid after applying of suggested pull request.
You can consider to define some standard templates for numbers, intergers and dates at the beginning of
grid.base.js
.Best regards
Oleg