Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Pending text colour (blue) after validation error status response

    When I use the RestDataSource and return a status of -4 (validation error?) then the faulty cell text of my ListGrid turns blue.

    This snippet from ListGrid.js shows that blue is the colour of a "pending edit":

    Code:
    //>	@attr	listGrid.editPendingCSSText    (string : "border:color:#0066CC;" : [IRWA])
    	//  Custom CSS text to be applied to cells with pending edits that have not yet been
        //  submitted.<br>
        // For further customization of styling for cells with pending edits use
        // <code>this.editPendingBaseStyle</code> instead.
    	// @visibility external
    	// @group	appearance
        // @see editFailedBaseStyle
    	//<
        editPendingCSSText:"color:#0066CC;",
    But this is -not- a pending edit, because the text turns 0066cc -after- receiving the -4 from the server.

    Basically this is a question about choreography; How do I enable the pending edit colour before and during the server round-trip, and finally let the text turn e.g. red upon validation error?

    Mayby I am not using the tools correctly?

    #2
    Hi Peter,

    It's an interesting semantic distinction, but SmartClient regards it as a pending edit that has failed validation. If you think about it, many validation errors are corrected by changing another field, so the value may actually be valid anyway.

    However if you wish to change the behavior, override getCellCSSText() and only call super if the cell has no errors (check via cellHasErrors()).

    Comment

    Working...
    X