Code Monkey home page Code Monkey logo

eztable's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

eztable's Issues

Modular support to Pager

Pager

  • Define a new property in builder object that named module. Module property is a container that holds extra scripts.
  • In module create page property too. This property loads pager script.

important: Module should cooperate with search and sort modules too.

  • When some thing searching, user can use pager too
  • When user sort things, pager should change too.

code reference

rowPerPage

(Integer) How much row will be print for each page.

onPageChange

(function) This event called when user click page.

example

var table = new ezTable({
  headers: {
    test: {
      title: 'pager test'
    }
  },

  module: {
    pager: {
      rowPerPage: 3,
      onPageChange: function(old, new) {}
    }
  }
});

table.bind("pagerTest");
table.load([
  {test: 1},
  {test: 2},
  {test: 3},
  {test: 4},
  {test: 5},
  {test: 6},
  {test: 7},
  {test: 8},
  {test: 9},
  {test: 10},
  {test: 11}
]);

generated view

Modular support to Search

Search

  • Define a new property in builder object that named module. Module property is a container that holds extra scripts.
  • In module create search property too. This property loads search script.

important: Module should cooperate with pager and sort modules too.

  • When click pager, user can use searching too
  • When user sort things, search should change too.

code reference

type

(String) Tells how search mechanism will work

  • number: Only numbers supported.
  • mail: When user entered valid mail then search will be started.
  • select: Possible choises will appears automaticly in combobox
  • solidSelect: Same as select, difference is developer must define selections
  • checkbox: Select for tick
  • string: default
typeDefinition

(Any) Stores information about types.
.

typeDefinition (type: solidSelect)

(Object) Stores Searching values. Key is Text that user see, Value is stores really search behind.

  ...
  deleted: {
     type: 'solidSelect',
     typeDefinition: {
       Yes: true,
       No:  false
     }
  }

example

var table = new ezTable({
  headers: {
    test: {
      title: 'search test'
    },

    cantSearchable: {
      title: 'no search :('
    }
  },

  module: {
    search: {
      test: {
        type: 'number',
        style: {
          width: "100%"
        },
        onKeyUp: function (target, e) {

        }
      }
    }
  }
});

table.bind("searchTest");
table.load([
  {test: 1},
  {test: 2},
  {test: 3},
  {test: 4},
  {test: 5},
  {test: 6},
  {test: 7},
  {test: 8},
  {test: 9},
  {test: 10},
  {test: 11}
]);

generated view

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.