EasyUI Forum

General Category => General Discussion => Topic started by: next on April 24, 2014, 03:26:29 AM



Title: how can i show my custom msg in the datagrid body,when the remote data.tatal = 0
Post by: next on April 24, 2014, 03:26:29 AM
how can i show my custom emptyText in the datagrid body,when the remote data.tatal = 0. I try it in the onLoadSuccess callback then appendRow and mergeCells but it seems no good, the gridheader columns will be merge too. the core like below:
onLoadSuccess:function (response) {
   if (!response.total) {
      $(selector).datagrid('appendRow',{
         'fieldName':'emptyText'
      }).datagrid('mergeCells',{
         index: 0,
         field: $(selector).datagrid('getColumnFields')[0],
         colspan: $(selector).datagrid('getColumnFields').length
      })
   }
}

ps: i hope it can be setting options like {emptyText:'no data!'}


Title: Re: how can i show my custom msg in the datagrid body,when the remote data.tatal = 0
Post by: stworthy on April 24, 2014, 06:20:58 AM
Please refer to this topic http://www.jeasyui.com/forum/index.php?topic=1881.0