Quantcast
Channel: BTSoru.com - Bilisim ve Yazilim Teknolojileri Soru/Cevap Platformu - latest questions
Viewing all articles
Browse latest Browse all 4270

Jquery datatables ile angularjs kullanımı birlikte nasıl olur?

$
0
0

Arkadaşlar basit bir örnek yapıyorum, Sayfamda bir table kullanıyorum. Bunda gösterilecek bilgileri angularjs ile controllerdan getirip bind işlemi yapıyorum. Ancak bu table ın datatables olasını istediğim zaman datatables içersindeki paging, search, order gibi özellikleri kullanamıyorum. Bu sorunu nasıl aşabilirim? kodlarım :

app.controller("customerCtrl", function ($scope, angularService) {
    GetAllCustomers();
    function GetAllCustomers() {
        var getData = angularService.getCustomers("/Customer/GetAllCustomers");
        getData.then(function (cus) {
            $scope.Customers = cus.data;
            $('#tblCustomer').DataTable();
        }, function () {
            alert("Error!");
        });
    };
});

<div class="row" ng-controller="customerCtrl">
    <table id="tblCustomer" class="table table-striped table-hover table-bordered" cellpadding="0">
        <thead>
            <tr>
                <th>Adı</th>
                <th>Soyadı</th>
                <th>Yaşı</th>
                <th>Mail Adresi</th>
                <th>Cinsiyeti</th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th>Adı</th>
                <th>Soyadı</th>
                <th>Yaşı</th>
                <th>Mail Adresi</th>
                <th>Cinsiyeti</th>
            </tr>
        </tfoot>
        <tbody>
            <tr ng-repeat="customer in Customers">
                <td>{{customer.Name}}</td>
                <td>{{customer.Surname}}</td>
                <td>{{customer.Age}}</td>
                <td>{{customer.Email}}</td>
                <td>{{customer.Gender}}</td>
            </tr>
        </tbody>

    </table>
</div>

Yardımlarınızı bekliyorum. Tşkler.


Viewing all articles
Browse latest Browse all 4270