EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: lusabo on February 27, 2012, 05:03:40 AM



Title: How to show a message in the datagrid when no records?
Post by: lusabo on February 27, 2012, 05:03:40 AM
Hi all,

I have a datagrid like below:

Code:
$('#listaRhapFRA').datagrid({
title: 'Relação dos FRAs',
url:'ControleAcompanharRhap.asp',
queryParams: {"psAcao": "obterfra", "psCPFUsuario": lsCPF},
columns:[[
{field:'CHAVEFRA', checkbox: true},
{field:'DATAINICIAL', title:'Data Inicial', width: 150}, 
{field:'DATAFINAL', title:'Data Final', width: 150}, 
{field:'DATAFECHAMENTO', title:'Data Fechamento', width: 150}, 
{field:'EQUIPE', title:'Equipe', width: 150},
{field:'SITUACAO', title:'Situação', width: 150}
]],
loadMsg: 'Carregando FRAs',
});

How to show a message (ex: No records found!) in the table when no records is returned?

Thanks,
Luciano


Title: Re: How to show a message in the datagrid when no records?
Post by: reems on May 15, 2013, 08:02:01 AM
Hello all,

Is there already a solution for this question.
I am interested also.

Thanks,
Reems


Title: Re: How to show a message in the datagrid when no records?
Post by: devnull on May 15, 2013, 04:27:11 PM
Hi;

How about this:

Code:
onLoadSuccess:function (data){
if(!data.total) alert('No Rows Returned');
});


Title: Re: How to show a message in the datagrid when no records?
Post by: cp_Burn on May 20, 2013, 10:17:39 AM
I had this problem last week. I used a work arround solution in php:

      
Code:
            if( $r == 'No records'){  
                $r[0]['Field1'] = 'No records to show.';
$r[0]['Field2']='';
$r[0]['Field3'] = '';
$r[0]['Field4'] = '';
$r[0]['Field5'] = '';
             }
echo json_encode($r);

Choose in what field you want to show your message.

Hope this help. See yah!