EasyUI Forum
May 15, 2024, 04:17:42 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Getting error on message  (Read 2751 times)
Steve2106
Newbie
*
Posts: 20


View Profile Email
« on: November 08, 2019, 03:10:05 PM »

Hi There,

I am deleting a record and when I get a message asking am I sure I want to delete there is an odd [object] [object] at the end of the text. (please see attachment)

This is the code calling the messageBox:
    function destroyCert(){
        var row = $('#dg').datagrid('getSelected');
        if (row){
            $.messager.confirm('Confirm','Are you sure you want to delete this certificate?' + row,function(r){
                if (r){
                    $.post('destroy_cert.php',{id:row.id},function(result){
                        if (result.success){
                            $('#dg').datagrid('reload');   // reload the user data
                        } else {
                            $.messager.show({   // show error message
                                title: 'Error',
                                msg: result.errorMsg
                            });
                        }
                    },'json');
                }
            });
        }
    }

Thanks for your help.

Best Regards,

Steve.
Logged
jahangir
Jr. Member
**
Posts: 51



View Profile Email
« Reply #1 on: November 08, 2019, 09:47:06 PM »


$('#dg').datagrid('getSelected') returns the data in JSON format, you should spacyfiy the field name that you want to show in message.
Code:
$.messager.confirm('Confirm','Are you sure you want to delete this certificate?' + row.yourfiedname ,function(r){
Logged
Steve2106
Newbie
*
Posts: 20


View Profile Email
« Reply #2 on: November 09, 2019, 03:24:00 AM »

Hi Jahangir,

Thanks for your reply. All working now.

Best Regards,

Steve.
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!