3.2.0

"Data not found" - how to change text dynamically

When there's no data to display, the grid shows the message "Data not found" in the top left corner.

Does anyone know how to change this text dynamically (rather than changing the default text in the grid code itself)?

Why? Well, in certain cases I want to display a message in the grid that there are "too many" results to display (so the "Data not found" text would be misleading). I don't want to change the text in the grid code itself, because in other cases when there is no data to display, the default message is spot on.

Thanks
Justin
February 23,
Here is the function returning status text:

obj.setStatusProperty("text", function(){

        switch(this.getStatusProperty("code")) {
            case "loading":
                return "Loading data, please wait...";
            case "nodata":
                return "No data found.";
            default:
                return "";
        }
    });


You may try to change this one or in combination with:

obj.setStatusProperty("code", function(){

        var data = this.getDataModel();
        if (!data.isReady()) {
            return "loading";
        }
        if (!this.getRowProperty("count")) {
            return "nodata";
        }
        return "";
    });
Alex (ActiveWidgets)
February 23,
Alex,

Thank you very much. Works perfectly.

Cheers
Justin
Justin
February 23,
Alex,

is it possible to set my own status text function as default? Something like a patch?

Thank you.
Dietrich
February 24,
yes, just use the above code as an example
Alex (ActiveWidgets)
February 25,

This topic is archived.

See also:


Back to support forum