Giter VIP home page Giter VIP logo

Comments (20)

manuquentin avatar manuquentin commented on September 2, 2024

Hello,
What do you mean by doesn't work ? Do you have any Javascript errors ? What is your configuration for this view ?

from ng-admin.

narigua avatar narigua commented on September 2, 2024

i put a custom template to add edit form directly in a row (with collapse). When i use FormController for this form, i have this error :
Error: [$injector:unpr] Unknown provider: viewProvider <- view

from ng-admin.

manuquentin avatar manuquentin commented on September 2, 2024

Thanks for the informations.
Do you use the 0.3.3 version or the master one ?

from ng-admin.

narigua avatar narigua commented on September 2, 2024

Last version, 0.3.3

from ng-admin.

narigua avatar narigua commented on September 2, 2024

How can i simply call editController in a view ?

from ng-admin.

manuquentin avatar manuquentin commented on September 2, 2024

Hello, we use controllerAs to inject the controller instance in the view.
You can use it like this

from ng-admin.

narigua avatar narigua commented on September 2, 2024

Thank you very much ;)

from ng-admin.

narigua avatar narigua commented on September 2, 2024

Hello,
I test this but don't work, what i've done :

Directive for customer entity :
app.directive('customerEdit', ['$location', function ($location) {
return {
controllerAs: 'frontController',
templateUrl: 'ng/customers/edit'
};
}]);

In templateUrl i have same the form that you said for edit, but submit don't work.

I've test to put directly ng-controller in the form, it's submit but don't update entity.

Any idea please ?

from ng-admin.

narigua avatar narigua commented on September 2, 2024

I've test with :
controllerAs: 'FormController'
controllerAs: 'EditController'

Any idea please ?

from ng-admin.

manuquentin avatar manuquentin commented on September 2, 2024

Hello,
Is this issue still related to ng-admin ?

from ng-admin.

narigua avatar narigua commented on September 2, 2024

Absolutely, because i don't find the way to call formController in rows list like you said.

from ng-admin.

RobinBressan avatar RobinBressan commented on September 2, 2024

IMO it is an angular issue, you should look at the require property for your directive, to get access to the parent controller you want.
see http://stackoverflow.com/questions/15622863/angularjs-directive-controllers-requiring-parent-directive-controllers and https://docs.angularjs.org/guide/directive#creating-directives-that-communicate

from ng-admin.

narigua avatar narigua commented on September 2, 2024

Thanks RobinBressan, it's a good track

from ng-admin.

fzaninotto avatar fzaninotto commented on September 2, 2024

Any progress on this one?

from ng-admin.

narigua avatar narigua commented on September 2, 2024

Yes i'm on it, just try to get formController in ListView.

from ng-admin.

narigua avatar narigua commented on September 2, 2024

Since the last update, it's cool for me to custom layout, and templates.

Just a little explanation:

I don't use require in my project, but i found how to integrate all custom view via directives.
I make directive for layout (works), but i test a directive for listView of an entity, it doesn't work for data. I think my problem is the controller: How can i call differents controller of ng-admin ?

Some code:

app.directive('customCustomersList', ['$location', function ($location) {
        return {
            templateUrl: '/ng/customers/list',
            controllerAs: 'DatagridController'
        };
    }]);

DatagridController ?
[...]

var customerCustomList = '<custom-customers-list></custom-customers-list>';

[...]

app.customTemplate(function(viewName, what) {
            if (viewName === 'ListView') {
                return customerCustomList;
            }
            if (viewName === 'EditView') {
                return customerCustomEdit;
            }
        })

from ng-admin.

narigua avatar narigua commented on September 2, 2024

No need to inject controllers, i just use my customTemplate based on listView ng-admin.
For my editRow, i use ng-repeat-start and ng-repeat-end to inject edit between each row, just with angular and bootstrap css.

from ng-admin.

fzaninotto avatar fzaninotto commented on September 2, 2024

OK, can you close the issue if it's OK for you?

Moreover, I think other ng-admin users would love to read about your customization. If you have a blog, would you mind writing a few lines about it?

from ng-admin.

narigua avatar narigua commented on September 2, 2024

Just to illustrate:

<tr ng-repeat-start="customer in customers">
    <td ng-click="collapseRows = !collapseRows" class="collapsible-row">{{customer.UserName}}</td>
</tr>
<tr ng-repeat-end ng-hide="collapseRows">
    <td>Edit Form</td>
</tr>

from ng-admin.

narigua avatar narigua commented on September 2, 2024

Sorry friend, but I never had time to make me a blog, and it's not envy that I am missing :(

from ng-admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.