Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the logic to read the cloned module configs form the configuration #1

Open
gabipetrovay opened this issue Aug 28, 2013 · 0 comments

Comments

@gabipetrovay
Copy link
Contributor

Use this CC Tool sample configuration and enhance this module to read the default configurations for the modules to be cloned from his own configuration.

The new configuration options look like:

"clones": {
    "filter": {
        "miid": "data_filter",
        "config": {
            ...
        }
    },
    "table": {
        "miid": "data_table",
        "config": {
            ...
        }
    }
}

Currently the crud_links module can only clone bind-filter and bind-table-crud modules. You read the above configuration like this: when the crud_links module wants to clone a data_filter module, use as the default config the configuration under clones.filter.config

To clone a module use the M.clone function:

M.clone(target, miidToClone, miidSuffix, newConfig, callback);
  • target is the selector or DOM reference where you want the cloned module to be loaded (can be the same selector since modules are always appended)
  • miidToClone is the miid of the module we want to clone. This must exist in the application.json and is read form the clones.filter.miid (same for clones.table.miid)
  • miidSufix is the suffix used to generate the miid of the new cloned module. (newMiid = miidToClone + miidSuffix)
  • newConfig is the dynamic configuration used during cloning to initialize the cloned module. This you also take from the configuration option: clones.filter.config or clones.table.config
  • callback is an optional callback function called after the initialization (HTML and init function) of the cloned module is done.
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

No branches or pull requests

2 participants