GithubHelp home page GithubHelp logo

pratyushmittal / angular-dragtable Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 4.0 403 KB

This is the pure AngularJS version of Dan Vanderkam's DragTable.

Home Page: http://fully-faltoo.com/angular-dragtable/

JavaScript 78.22% HTML 21.78%

angular-dragtable's People

Contributors

pratyushmittal avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

angular-dragtable's Issues

Missing javascript licensing header

The original dragtable you reference contains the below header in the Javascript. This project has no license header. It is unclear whether your code is a direct modification of the other code, or whether it is an independent implementation.

  1. Is your code also licensed under the MIT license?
  2. Is your code a modification of the original dragtable? If so, shouldn't the original license header be included?
  3. Can you add a license header to the javascript file?

/**

  • Licensed under the MIT license.
    *
  • Here's the notice from Mike Hall's draggable script:
    *
  • Do not remove this notice.
    *
  • Copyright 2001 by Mike Hall.
  • See http://www.brainjar.com for terms of use.
    */

Not working with pagination

When there is pagination then this plugin is not working.
To produce the bug:

  1. Change column position by dragging
  2. Go to the another page using pagination
  3. Column header will stay as it is as you dragged but the column content will move to its original position

Unable to drag if columns are generated by an ng-repeat

I can't seem to get draggable columns if the columns are generated by an ng-repeat. It works fine otherwise. Can you tell me if I'm doing something wrong here? Also, is it possible to do drag handles?

<table class="table table-bordered" draggable>
  <thead>
    <tr>
      <th ng-repeat="column in record.columns">{{column.name}}</th>
    </tr>
  </thead>

  <tbody>
    <tr ng-repeat="i in $times(record.rows)">
      <td ng-repeat="column in record.columns" ng-tap="translateOpen(column.rows, i)">{{column.rows[i]}}</td>
    </tr>
  </tbody>
</table>

Logic for persisting and restoring

best thing would be to bind a scope variable to the directive

e.g. with a sub directive for first columns (e.g. headers [th]):

<script>
function Controller($scope) {
  $scope.tableColumnOrder = {
    idColumn: 1,
    nameColumn: 2
  };
}
</script>

<table draggable="tableColumnOrder">
  <tr>
    <th dragable-column="idColumn">Id</th>
    <th dragable-column="nameColumn">name</th>
  </tr>
</table>

the result would be:

<table draggable="tableColumnOrder">
  <tr>
    <th dragable-column="nameColumn">name</th>
    <th dragable-column="idColumn">Id</th>
  </tr>
</table>

and on drag end (or on change...whatever) you would change the scope variable.

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.