kiran
kiran

Reputation:

images and selectbox in jqgrid

hai i am very new to jquery and jqgrid.. i have implemented a grid...but i don't have any idea to display images in column from the corresponding database value...i tried a lot but failed ..can anybody help me.. regards

Upvotes: 0

Views: 2249

Answers (1)

Ron Harlev
Ron Harlev

Reputation: 16673

In the setup parameters add:

            loadComplete: function() {
              var ids = $("#list").getDataIDs();
              for (var i = 0; i < ids.length; i++) {
                var cl = ids[i];
                be = "<img src='http://www.google.com/images/nav_logo6.png'>";
                $("#list").setRowData(ids[i], { externalId: be })
              }
            },

In this example it will load the google logo. This sample goes over all the rows and adds the same item. You can change it do be more dynamic based on the current value of the cell etc.

Upvotes: 1

Related Questions