<template>
    <config-page 
        :app="app"
    />
</template>

<script>
    export default {
        props: {
            app: {require: true},
        },

        components: {
            ConfigPage: require('./../components/ConfigPage').default,
        },

        created() {
            this.app.AddClassesByContext(require.context('./../../Classes', true, /\.class.js$/i));
            this.app.AddDataProvidersByContext(require.context('./../../DataSessions', true, /\.dataprovider.js$/i));
            this.app.AddDatatablesByContext(require.context('./../../Datatables', true, /\.datatable.js$/i));
            this.app.AddFormProvidersByContext(require.context('./../../FormProviders', true, /\.formprovider.js$/i))
            this.app.AddFormsByContext(require.context('./../../Forms', true, /\.form.js$/i));
            // 
            // this.app.AddMenusByContext(require.context('./../../Menus', true, /\.menu.js$/i));


            this.app.forms.Config.SetFormProvider( this.app.formproviders.Config );

            /**
             * Ca fac coloana editabila
             */
            this.app.datatables.Config._columns['value-column'].editable.AttachForm(this.app.forms.Config)


            /**
             * atasez dataproviderul la datatable
             */
            this.app.datatables.Config.RegisterDataProvider(this.app.dataSession.Config);

        },

        name: 'Index',
    }
</script>