R – images and selectbox in jqgrid

imagejqgrid

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

Best Answer

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.

Related Topic