Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
wiki:custom_formatter [2011/09/17 16:49] artemeey |
wiki:custom_formatter [2017/12/12 19:13] (current) admin |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Custom Formatter ====== | ====== Custom Formatter ====== | ||
| You can define your own formatter for a particular column. Usually this is a function. When set in the formatter option this should not be enclosed in quotes and not entered with () - show just the name of the function.For example, | You can define your own formatter for a particular column. Usually this is a function. When set in the formatter option this should not be enclosed in quotes and not entered with () - show just the name of the function.For example, | ||
| + | |||
| <code javascript> | <code javascript> | ||
| <script> | <script> | ||
| Line 48: | Line 48: | ||
| The answer is: You can use your own custom unformatter function to do that. This function can be used in colModel | The answer is: You can use your own custom unformatter function to do that. This function can be used in colModel | ||
| - | <code javascript> | + | Show image and edit image's path: |
| - | <script> | + | |
| - | jQuery("#grid_id").jqGrid({ | + | |
| - | ... | + | |
| - | colModel: [ | + | |
| - | ... | + | |
| - | {name:'price', index:'price', width:60, align:"center", editable: true, unformat:myunformatfunc}, | + | |
| - | ... | + | |
| - | ] | + | |
| - | ... | + | |
| - | }); | + | |
| - | + | ||
| - | + | ||
| - | Image: | + | |
| <code javascript> | <code javascript> | ||