Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Conversation

frenautvh
Copy link
Contributor

@frenautvh frenautvh commented May 23, 2018

Wait for row promise to be resolved before displaying row template.

For example :

<oui-column>
    <span data-ng-if="$row.foo">Foo</span>
    <span data-ng-if="!$row.foo">Bar</span>
</oui-column>

Will display "Bar" during on the fly row loading which is not intended (we expect cell to be left blank). This fix wait the promise to be resolved and then compile the cell template.

this.$element.css("display", "block");

this._compileCell();
if (this.row && this.row.$promise) {
Copy link
Contributor

@FredericEspiau FredericEspiau May 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

this.$q
	.when()
	.then(() => _(this.row).get("$promise"))
	.finally(() => this._compileCell());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like your suggestion but i think an "if" is more straightforward and easier to read in that case

@frenautvh frenautvh requested a review from jimmyfortinx May 23, 2018 13:14
@AxelPeter AxelPeter merged commit 6083efc into develop May 25, 2018
@AxelPeter AxelPeter deleted the fix/datagrid-pending-cells branch June 4, 2018 12:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

5 participants