EasyUI Forum
May 04, 2024, 03:47:31 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: menu in datagrid in tooltip  (Read 3849 times)
sky-t
Full Member
***
Posts: 145


View Profile
« 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
Logged
sky-t
Full Member
***
Posts: 145


View Profile
« Reply #1 on: April 22, 2019, 02:14:25 AM »

Hi there,

i solved the problem!!!!
Logged
sky-t
Full Member
***
Posts: 145


View Profile
« Reply #2 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 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);

}
})
}
})
Logged
sky-t
Full Member
***
Posts: 145


View Profile
« Reply #4 on: April 23, 2019, 11:23:53 PM »

Hi stworthy,

this works GREAT!!!


Thank you so much!!!!!!!!!!!!!!!!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!