Default Text Label when pagelist empty

Hi,

How can I set default text label when my pagelist has no items (empty)? Looks ugly if just showing blank screen.

Thanks.

You can define list as

var list = dhx.ui({ view:"list", ... ready:function(){ if (!this.dataCount()){ dhx.extend(this, dhx.ui.Overlay); this.showOverlay("There is no data"); } }, url:"data.php" });

above code will fire “ready” handler after initial data loading, and if no data loaded - will show overlay text other control ( you can use any html inside showOverlay )

Thanks for the advice. My code have some issues when extending object:

Uncaught TypeError: Cannot read property ‘Pb’ of undefined
dhx.extendtouchui.js:8

It’s the same issue as my other question in the forum (extending KeyPress)

Such error can occurs if you are provide non-object as one of parameters of dhx.extend

Thanks for the pointer. But the ready event never get fired in my case here:

var recentInboxView = {
id:“recentInboxList”,
css: “basicBG”,
view:“pagelist”,
selected:true,
scroll:“y”,

ready:function(){
	alert (this.dataCount());
           if (!this.dataCount()){
              dhx.extend(this, dhx.ui.Overlay);
              this.showOverlay("There is no data");
          }
  },
						  
type:"messages",

scrollOffset:30 /*to stop scroll with 30px from the top edge of an item*/

};

I am using proxy as data source.

Instead of ready - you can use onXLE event or callback of load command.

Got the event, no error - but overlay doesn’t work :cry:

messageStore.attachEvent(“onXLE”,function(id){
if (!this.dataCount()) {
alert (‘overlay’);
dhx.extend($$(“recentInboxList”), dhx.ui.Overlay);
$$(“recentInboxList”).showOverlay(“

There is no data

”);
				}
				         
        	});

Sorry for inconvenience, there were some problem in dhtmlx touch code.
Updated js file and sample of usage are attached.
lit.zip (81.5 KB)

It works, with little bug: the loading icon pop up when I show the message. Can help to fix.

Thanks

and may I know how to remove the overlay?

Add the next css rule to the page

.dhx_loading_overlay{ background:white; }