EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: sky-t on April 22, 2019, 01:28:08 AM



Title: menu in datagrid in tooltip
Post by: sky-t on April 22, 2019, 01:28:08 AM
Hi there,

i have another problem - i have a datagrid which contains a menu for each row so the user can choice an action for each row by the menu. The datagrid is shown by a tooltip - so far so good.
Now, when i open the menu the tooltip and so, the datagrid disapears becouse the tooltip lost cursor i guess.

How can i prevent this behaviour?


Thank you so much


Title: Re: menu in datagrid in tooltip
Post by: sky-t on April 22, 2019, 02:14:25 AM
Hi there,

i solved the problem!!!!


Title: Re: menu in datagrid in tooltip
Post by: sky-t on April 23, 2019, 07:40:52 AM
Hi there,

my datagrid with the menubuttons and menus works.

My problem is that i need to know the row.id - but menu popups by mousehover without selecting the row.
How can i achieve the row id by this way?


Thanks


Title: Re: menu in datagrid in tooltip
Post by: stworthy on April 23, 2019, 07:14:34 PM
Set the 'showEvent' property to 'click' instead of 'mouseenter', the menubutton doesn't show drop-down menu until the user click the button. Please try this code.
Code:
$('#dg').datagrid({
columns: [[
{field:'itemid',title:'Item ID',width:100},
{field:'act',title:'Action',width:100,
formatter: function(value,row,index){
return '<a class="act-btn" rowindex='+index+' href="javascript:;">button</a>';
}
}
]],
onLoadSuccess: function(){
$(this).datagrid('getPanel').find('.act-btn').menubutton({
menu: '#mm',
showEvent: 'click',
onClick: function(){
var index = $(this).attr('rowindex');
$('#dg').datagrid('selectRow', index);

}
})
}
})


Title: Re: menu in datagrid in tooltip
Post by: sky-t on April 23, 2019, 11:23:53 PM
Hi stworthy,

this works GREAT!!!


Thank you so much!!!!!!!!!!!!!!!!