:: Forum >>

"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
Wednesday, February 23, 2005
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)
Wednesday, February 23, 2005
Alex,

Thank you very much. Works perfectly.

Cheers
Justin
Justin
Wednesday, February 23, 2005
Alex,

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

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

This topic is archived.


Back to support forum

Forum search