GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — making formatter api like cellStyle · fengwit/bootstrap-table@002c474

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • docs/_i18n/en/documentation
    • column-options.md
  • src
    • bootstrap-table.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/_i18n/en/documentation/column-options.md‎

Copy file name to clipboardExpand all lines: docs/_i18n/en/documentation/column-options.md
+12-1Lines changed: 12 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,18 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
164164
The cell formatter function, take three parameters: <br>
165165
value: the field value. <br>
166166
row: the row record data.<br>
167-
index: the row index.</td>
167+
index: the row index.<br>
168+
field: the row field.<br>
169+
Example usage:<br>
170+
<pre>
171+
function formatter(value, row, index, field) {
172+
if (value === 'foo') {
173+
return '<strong>' + value + '</strong>';
174+
}
175+
return value;
176+
}
177+
</pre>
178+
</td>
168179
</tr>
169180
<tr>
170181
<td>footerFormatter</td>
Collapse file

‎src/bootstrap-table.js‎

Copy file name to clipboardExpand all lines: src/bootstrap-table.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1736,7 +1736,7 @@
17361736
}
17371737

17381738
value = calculateObjectValue(column,
1739-
that.header.formatters[j], [value_, item, i], value_);
1739+
that.header.formatters[j], [value_, item, i, field], value_);
17401740

17411741
if (item['_' + field + '_data'] && !$.isEmptyObject(item['_' + field + '_data'])) {
17421742
$.each(item['_' + field + '_data'], function(k, v) {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.