0

I would like to launch a LightBoxNano image popup when clicking a cell in a dgrid.

How can I achieve this?

Thanks!

Here is some code:

    var columns = [
    {
        label: 'Picture',
        field: 'filename',
        formatter: function(filename){
            return '<div class="icon" style="background-image:url(/images/client/thumbnails/' + filename + ');"><a data-dojo-type="dojox.image.LightboxNano" class="iconlink" href="/images/client/' + filename + '">&nbsp;</a></div>';
        }
    },
    Editor({label: 'Type', field: 'filetype', widgetArgs: {store: filetypeStore, maxHeight: 150, style: "height: 20px;"}}, FilteringSelect),
    Editor({label: 'Subtype', field: 'filesubtype', widgetArgs: {store: filesubtypeStore, maxHeight: 150, style: "height: 20px;"}}, FilteringSelect)
];

Do I miss something??

Thanks!

ps202
  • 95
  • 2
  • 11
  • Cell [formatters](http://dojotoolkit.org/reference-guide/1.9/dojox/grid/DataGrid.html#usage)? I don't know if `dgrid` uses the same formatters as the original grid widget. – undefined Nov 04 '13 at 09:34
  • I tried cell formatters, but for some reason they don't seem to work... – ps202 Nov 04 '13 at 10:37

1 Answers1

0

So, I used a Dialog insted of a Lightboxnano.

    imageList.on(".dgrid-content .iconlink:click", function (evt) {
    evt.preventDefault();
    var data = dojo.getAttr(this, "href");

    var picdial = new Dialog({
        title: "Pic: " + data.substr(15),
        content: '<img src="' + data + '">'
    });

    picdial.show();
  });
ps202
  • 95
  • 2
  • 11