GithubHelp home page GithubHelp logo

Image not supported about gijgo HOT 3 CLOSED

atatanasov avatar atatanasov commented on May 21, 2024
Image not supported

from gijgo.

Comments (3)

atatanasov avatar atatanasov commented on May 21, 2024

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.

NarenGummadi avatar NarenGummadi commented on May 21, 2024

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.

atatanasov avatar atatanasov commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.