3.2.0

No data

Alex,

I propose the following change to allow for an easy way to display a "No data was found" message (this was inspired by your "message" template which works great by the way):

1) In Grid.js, add the following inside the "Active.Controls.Grid.create" function:
obj.defineTemplate("nodata", new Active.HTML.DIV);

2) In list.js, replace the current "html" function with the following:
var html = function(){
var data = this.getDataModel();
if (!data.isReady()) {return this.getMessageTemplate()}
var i, result = [], temp = [], items = this.getItemsProperty("values");
if (items.length==0) {return this.getNodataTemplate()}
for(i=0; i<items.length; i++) {result[i] = this.getItemTemplate(items[i], temp).toString()}
return result.join("");
};
obj.setContent("html", html);

Jeremie
April 2,
Yes, agree. I just want to move template switching logic out of the list template, so anyone can add 'special case' template and easily specify when it should be used.
Alex (ActiveWidgets)
April 2,

This topic is archived.

See also:


Back to support forum