EasyUI Forum
May 20, 2024, 06:51:39 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: how cancel onshowPanel event of a combogrid  (Read 7829 times)
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« on: January 16, 2014, 06:18:19 PM »

hi everybody!

How I can send a message (messager) confirmation before people choose another option on a combogrid?

What event would launch the message?

when they click the arrow of a combogrid to be asked:

Already save yours changes?

if yes -> that allows you to select
if the answer is no -> to be able to keep you cancel the event onshowPanel combogrid

thanks
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 17, 2014, 12:14:34 AM »

No events can be used to interrupt the clicking action on arrow. But you can re-bind the click event on arrow to handle your own logic.
Code:
$(function(){
var cg = $('#cg'); // the combogrid
cg.next().find('.combo-arrow').unbind('.combo').bind('click.combo',function(e){
var p = cg.combogrid('panel');
if (p.is(':visible')){
cg.combogrid('hidePanel');
return;
}
$.messager.confirm('Confirm','Already save yours changes?',function(r){
if (r){
cg.combogrid('showPanel');
}
});
});
});
Logged
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« Reply #2 on: January 17, 2014, 10:11:07 AM »

ok it works!!

thank you
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!