"No Records/ Data" message in List

Hello,

I am using List for data presentation that are populated from the server, how can I set a “No Records Found” message in List if data return is empty. thank you!

PS: When we will expect a library update for touch? The dhtmlx library update last june is great, now I am now excited with the dhx.touch update, hope it will be release soon :slight_smile:

Hello,

I am using List for data presentation that are populated from the server, how can I set a “No Records Found” message in List if data return is empty.

You can set onXLE event handler that fires on event loading. In this handler, you can add a list item with “No records” message:

list.attachEvent("onXLE", function(){ if(!this.count()) this.add({id: "no_records", value: "No records"}); });

Or you can use css solution:

<style> .my_list > div:before{ content: "No Records Found"; font-size: 16px; font-weight:bold; color: #aaa; } .my_list > div{ text-align: center; } </style> ... list.attachEvent("onXLE", function(){ if(!this.count()) this.$view.className += " my_list"; else this.$view.className = this.$view.className.replace(" my_list",""); });

When we will expect a library update for touch? The dhtmlx library update last june is great, now I am now excited with the dhx.touch update

Thank you for your kind words about our library.
We plan to release the updated Touch version in August.

Hi Alexandria,

Your code snippet works great, thanks a lot! :smiley:

Hi,

You are welcome!