Skip to content

Conversation

@shaoshiva
Copy link
Collaborator

Adds a new behaviour property that gives the ability to populate the virtual name with something other than the title. The value of this new behaviour property can be either a property or a method of the model.

Be careful, this new property will not affect the javascript part of the renderer that will always use the title to dynamically generates the virtual name.

To make it work with the renderer we need to rethink the way the virtual name is dynamically generated in javascript (eg. with an ajax call).

Adds a new behaviour property that give the ability to populate the virtual name with something other than the title. The value of this new behaviour property can be either a property or a method of the model.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would have done the other way around : give priority to method and then to property.

@Meroje
Copy link
Collaborator

Meroje commented Mar 31, 2015

It needs to accept a closure to allow dynamic insertion of the behaviour imo.

@vrcAlbert
Copy link
Contributor

It needs to accept a closure to allow dynamic insertion of the behaviour imo.

Indeed, using closure must be possible if methods added by behaviours are not recognized by "method_exists".
That would be the only two ways to override it.

@Foine
Copy link
Collaborator

Foine commented Apr 1, 2015

@Meroje & @vrcAlbert 👍

1 similar comment
@jguyomard
Copy link
Collaborator

@Meroje & @vrcAlbert 👍

@shaoshiva shaoshiva changed the title New behaviour property to populate the virtual name [WIP] New behaviour property to populate the virtual name Oct 26, 2016
@shaoshiva
Copy link
Collaborator Author

PR updated :

  • implements the populate callback in the renderer's javascript (via an AJAX request)
  • adds an option to regenerate the virtual name after creation (eg. to generate a virtual name with the item ID)

Todo: implement a mechanism in the renderer's javascript to observe fields and regenerate the virtual name when they change (currently only the title is observed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants