Git Product home page Git Product logo

angular-rn-table's Introduction

Angular-RN-Table

angular table

Dependencies

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.css"/>
<link rel="stylesheet" href="css/rnTable.css"/>
<script src="bower_components/angular/angular.js"></script>
<script src="js/rnTable.js"></script>

Add rnTable

<table class="table table-bordered rnTable" rn-Table="" rn-Data="users" rn-Col-Defs="cols" rn-Items="5">
</table>
$scope.users = [{
        Id: 1, Name: 'Test Name 1',Age : 12,
        Country: 'INDIA',BirthDay: "20-1-2000"
    },{
        Id: 2,Name: 'Test Name 2', Age : 13,
        Country: 'USA',BirthDay: "20-12-2001"
    },{
       Id: 3,Name: 'Test Name 3',Age : 14,
       Country: 'UK',BirthDay: "20-12-2002"
    },{
        Id: 4,Name: 'Test Name 4',Age : 15,
        Country: 'RUSIA',BirthDay: "20-12-2003"
    },{
        Id: 5,Name: 'Test Name 5',Age : 16,
        Country: 'CHINA',BirthDay: "20-12-2004"
    },
    {
        Id: 6,Name: 'Test Name 5',Age : 16,
        Country: 'CHINA',BirthDay: "20-12-2004"
    },
    {
        Id: 7,Name: 'Test Name 5',Age : 16,
        Country: 'CHINA',BirthDay: "20-12-2004"
    }];

AND column definitions

$scope.cols = [{
        field: 'Id',
        displayName: "Demographic Id",
        sortable : false,
        filterable : true,
        sortingType: "number"
    },
    {
        field: 'Name',
        displayName: "Demographic Name",
        sortable : true,
        filterable : true,
        sortingType: "string"
    },
    {
        field: 'Age',
        displayName: "Demographic Age",
        sortable : true,
        filterable : true,
        sortingType: "string"
    },
    {
        field: 'Country',
        sortable : true,
        filterable : true,
        cellTemplate: "<input type='text' class='form-control' ng-click='cellTemplateScope.click(data[col.field])' ng-model='data[col.field]' value='{{data[col.field]}}'/>",
        cellTemplateScope: {
            click: function(data) {
                console.log(data);
            }
        },
        sortingType: "string"
    },
    {
        field: 'BirthDay',
        displayName: "Demographic Birthday",
        sortable : true,
        filterable : true,
        sortingType: "date"
    }];

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.