EasyUI Forum
May 16, 2024, 07:13:59 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 to show a message in the datagrid when no records?  (Read 16919 times)
lusabo
Newbie
*
Posts: 8


View Profile
« 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
Logged
reems
Newbie
*
Posts: 14


View Profile
« Reply #1 on: May 15, 2013, 08:02:01 AM »

Hello all,

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

Thanks,
Reems
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: May 15, 2013, 04:27:11 PM »

Hi;

How about this:

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

-- Licensed User --
cp_Burn
Newbie
*
Posts: 4


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