A question between dataView and contextual Menu

I use the dataView to display a lot of pictures, I use contextual menu to each picture so when I right click the mouse on one picture, a menu will be appeared. Before I select any item on dataView it works normally. But after I do select, the menu can’t appear with right click. So why is this?

Locally it works fine, Please, look at the attahed sample
14.01.21.rar (217 KB)

Tanks, Darya. After I read the sample you sent to me, I have two question.
First, where can I find the event named “onBeforeContextMenu” and the method named “_doOnContextBeforeCall”. I didn’t find something like that though I looked through the API about “DHTMLXDataView” and “DHTMLXMenu”.
Second, if I want to load different menu, but I can’t confirm what items need the different one. How can I do that?

  1. onBeforeContextMenu id added to events list of dataview
    docs.dhtmlx.com/doku.php?id=dhtm … ontextmenu
    dhtmlx.com/docs/products/dht … _menu.html
    _doOnContextBeforeCall is inner method - you will not find it in API list online
  2. there is a 1th parameter in “onBeforeContextMenu” - id. You need to check some properties of this item to get the right variant of menu structure
    You can use method get() to return hash of data, related to specific ID and check i.e. unshown part of item.
    DataView config:

data = new dhtmlXDataView({ container: "data_here", type: { template: "#Package# : #Version#<br/>#Maintainer#", padding: 5, height: 40; }, x_count: 3; });
Item type checking:

var type = view.get(id).Type; if(type == "a"){ showContextMenu_a() } else showContextMenu_b()