Comments (3)
You can use column.renderer function in order to do that.
You can find documentation about this function at http://gijgo.com/grid/Configuration/column.renderer
Here is an example:
<table id="grid" data-source="/Grid/GetPlayers"></table>
<script>
var imageRenderer = function (value, record, $cell, $displayEl) {
$displayEl.append('<img src="https://lh4.ggpht.com/wKrDLLmmxjfRG2-E-k5L5BUuHWpCOe4lWRF7oVs1Gzdn5e5yvr8fj-ORTlBF43U47yI=w300" />');
};
$('#grid').grid({
uiLibrary: 'jqueryui',
columns: [
{ field: 'ID', width: 30 },
{ field: 'image', renderer: imageRenderer }
]
});
</script>
from gijgo.
It loads image however, sorting any column adds new image again which makes the column hold same image repeatedly.
Tested here - http://gijgo.com/LiveEdit/Index/jquery-grid-bootstrap.html?component=grid and can reproduce the issue.
Probably adding below line before append method could fix it, Please correct me
$displayEl.empty();
from gijgo.
yes. You always need to clear the display element in the renderer function.
If you add $displayEl.empty(); in the renderer function everything is going to work fine
from gijgo.
Related Issues (20)
- Grid Dropdown in Edit Mode HOT 1
- Give the input placeholder option & Also make a default date value for the input. HOT 1
- Question: Do you have something like getNodeByPath on the tree? HOT 1
- You can use (-) to get indefinite checkboxes
- Tree Issues: What am I missing? HOT 6
- getCheckedNodes is not a function if tree is in a modal HOT 1
- Question: Changing an array dataSource at runtime & refresh the tree.
- Add enable and disable methods for datepicker and timepicker
- Add creatable option for dropdown like react-select
- Grid updateRow() fails when called for rows after an expanded row
- bootstrap4,dislog.destroy()调用之后会把dom元素<button class="btn btn-secondary" data-role="close" >Cancel</button>删除。
- tree.on('checkboxChange'
- selection expand throught all children
- Pick month only
- Want a "selectionType: 'none' " to be able to only use checkboxes.
- Question: How can I clear all the nodes in the treeview at once?
- Question: Is it possible to set the dataSource from an array from an existing tree instance?
- tree.parents example not working
- how to display the date from db in gigo grid HOT 1
- Bootstrap button icon 5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gijgo.