Base solution for your next web application

Activities of "paddyfink"

Hello,

I have the same problem. I can't find a way to use Kendo Grid.

@Klainer did u found a solution?

@hikalkan Is it possible to deactivate abp ajax wrapper?

Thank you.

Excellent. Thanks

I will follow you on twitter to be notify when there is a new version.

For those having the same issue, the solution is to set a Custom DataSource configuration. This will allow you to set a custom function for the schema.parse and return the appropriate portion of the response. For example:

@(Html.Kendo().Grid<MyModel>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(typeof(string), "column1");
        columns.Bound(typeof(string), "column2");
    })
    .Pageable()
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource
            .Custom()
            .ServerFiltering(true)
            .Type("aspnetmvc-ajax")
            .Transport(transport =>
                transport.Read(read => read.Action("action", "controller"))
            )
            .Schema(schema => schema
            .Model(m=>m.Id("columId"))
              .Parse(@<text>
                    function(response) {
                    return response.result;
                    }
                </text>)
            .Data("data")
            .Total("total")
            )
        )
    )

Be aware that if a property of you Model is "PropertyName" it will became "propertyName" in ajax response. so columns.Bound(p => p.PropertyName) wont' work.

Hey there, I'm having the same issue in a mvc controller.

public ActionResult Grid_Read([DataSourceRequest] DataSourceRequest request)
        {
            var suppliers = GetAll();

            return Json(suppliers.ToDataSourceResult(request));
        }

        [UnitOfWork]
        public virtual IEnumerable<SupplierListOutput> GetAll()
        {
           return _supplierRepository.GetAll().ProjectTo<SupplierListOutput>();
        }

I'm using kendo ui Grid component that can performs filtering, sorting, paging.... That's why I need to have a direct acces to the repository in my controller and pass a IQueryable variable in my action method .

But I stilll have the error : The operation cannot be completed because the DbContext has been disposed.

The repository is injected in the controller constructor

Question

Hello,

I want to use a regulard Web API 2 project instead of the self-hosted project generated by the template. So i added a new web api 2 project to solution. I added the packe abp.web.api. I added the module class and the dependency

[DependsOn(
        typeof(TestDataModule),
        typeof(TestApplicationModule),
        typeof(AbpWebMvcModule),
        typeof(AbpWebApiModule))]
    public class TestApiModule : AbpModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

            DynamicApiControllerBuilder
                .ForAll<IApplicationService>(typeof(TestApplicationModule).Assembly, "app")
                .Build();

            Configuration.Modules.AbpWebApi().HttpConfiguration.Filters.Add(new HostAuthenticationFilter("Bearer"));

        }
    }

But when I tried to call directly a service from the application project, I have 404 not found error. When I tried to call directly a controller, I have the error : "An error occurred when trying to create a controller of type 'WhateverController'. Make sure that the controller has a parameterless public constructor."

It seems like an error related to the IoC mechanism.

Am I missing something? thanx

Answer

Hello,

Indeed, the Initialize method was never called. So I checked again and I compare the project to the one created by the template. It turns out that my application class wasn't implemented AbpWebApplication. It works now. Thanks

Question

Hello

I have the following routing configuration:

app.config([
        '$stateProvider', '$urlRouterProvider',
        function ($stateProvider, $urlRouterProvider) {
            $urlRouterProvider.otherwise('/');

            if (abp.auth.hasPermission('Pages.Tenants')) {
                $stateProvider
                    .state('tenants', {
                        url: '/tenants',
                        templateUrl: '/App/Main/views/tenants/index.cshtml',
                        menu: 'Tenants' 
                    });
                $urlRouterProvider.otherwise('/tenants');
            }

            $stateProvider
                .state('home', {
                    url: '/',
                    templateUrl: '/App/Main/views/home/home.cshtml',
                    menu: 'Home' 
                })
                .state('about', {
                    url: '/about',
                    templateUrl: '/App/Main/views/about/about.cshtml',
                    menu: 'About' 
                })
                .state('suppliers', {
                    url: '/suppliers',
                    templateUrl: '/App/Main/views/suppliers/index.cshtml',
                    menu: 'Suppliers' 
                })
                .state('supplierDetail', {
                    url: '/suppliers/:id',
                    templateUrl: '/App/Main/views/suppliers/detail.cshtml',
                    menu: 'Suppliers'
                });
        }
    ]);

But it doesn't work for the supplier detail. The folowing url doesn't work and keep redirect me to the home page : <a class="postlink" href="http://localhost:4000/#/Suppliers/809d3d83-7cbd-e511-beea-6c8814f37e8c">http://localhost:4000/#/Suppliers/809d3 ... 8814f37e8c</a>

I'm beginner in angular and I'm sure it must be something stupid, but I can't find where the problem is. There is no error message in the log or in the browser console. I don't know where to look. I've looked the angular-ui routing documentation and I didn't find something to point me to the right direction.

am I missing something in the configuration? Thanks for your help.

it's a requirement for EF to be able to create poco proxies

<a class="postlink" href="http://stackoverflow.com/questions/5597760/what-effects-can-the-virtual-keyword-have-in-entity-framework-4-1-poco-code-fi">http://stackoverflow.com/questions/5597 ... co-code-fi</a>

Hello,

Like you I created also a separate web api project to host it on its own server. You can still have all the features abp.

for the Dynamic web api, you just have to add this code on your module class ( you have to create manually one and inherited from abpmodule) :

DynamicApiControllerBuilder
               .ForAll<IApplicationService>(typeof(MyAppApplicationModule).Assembly, "app")
               .WithConventionalVerbs()
               .Build();

Hi halil,

I try to integrate the notification system into my existing explication. I have one problem : nothing get fired on the client side. this function is never called :

//Register to get notifications
    commonHub.client.getNotification = function (notification) {
        abp.event.trigger('abp.notifications.received', notification);
    };

If I execute the directly this command on my browser console, I can catch the event: abp.event.trigger('abp.notifications.received', {message: 'something'});

So the problem is coming form commonhub. And also I noticed something weirg on the log, I get registered, but the userid and tenantid are null : A client is connected: {"ConnectionId":"671a0694-5b35-4ac3-90b1-a9c4cc831cdd","IpAddress":"::1","TenantId":null,"UserId":null,"ConnectTime":"2016-03-07T13:40:25.2281687-05:00","Properties":{}} and again to information are supposed to be fill in the class AbpCommonHub

Maybe I missed something in the configuration. There is something to do for the class abpcommonhub to work correctly on a existing project? I've already add [DependsOn(typeof(AbpWebSignalRModule))] on my web module.

Showing 1 to 10 of 35 entries