Giter Site home page Giter Site logo

riot-widgets's People

Contributors

predictabilityisgood avatar

Stargazers

 avatar

Watchers

 avatar

riot-widgets's Issues

clicking row does not recalculate the toggle all state

Description

this.editState does not initiate a selection check to determine whether or not all rows are selected. This causes the toggle all button to ignore the single purpose it was supposed to reflect...

Solution

if(Object.keys(this.state.selected).length==this.state.data.length){
    this.state.all=true;
}

refactoring selection check code (above) found in this.toggleRow into new function this.AllRowsSelected that is reused in this.toggleRow and this.editState as they perform similar functions

Reproduction

Initiate a table where only 1 record exists, and select the record by selecting anything but the row toggle checkbox

heuristic gesture callbacks

Description

An enhancement for initiating row/cell heuristic gesture callbacks for events for Table/Row/Cell

  1. click (inherit standard click event)
  2. double click (inherit standard dblclick event)
  3. hover ( inherit standard mouseenter activating 2s setTimeout without mouseout? Settings to change delay time?)
  4. hold ( inherit standard mousedown activating 1.5s setTimeout without mouseup? Settings to change delay time?)
  5. ?

Suggested solution

add callbacks for events above for => within:
table => .tableOptions (EXISTING)
row => .rowOptions (NEW)
cell => .options (EXISTING)
implemented like

// table => tableOptions (EXISTING)
tableOptions:{
   callbacks:{
      click:(el)=>console.log('clicked',el),
      dblclick:(el)=>console.log('double clicked',el),
      hover:(el)=>console.log('hover',el),
      hold:(el)=>console.log('hold',el),
   }
}
//... row => rowOptions (NEW)
rowOptions:{
   callbacks:{
      click:(el)=>console.log('clicked',el),
      dblclick:(el)=>console.log('double clicked',el),
      hover:(el)=>console.log('hover',el),
      hold:(el)=>console.log('hold',el),
   }
}
//... cell => .options (EXISTING)
options:{
   callbacks:{
      click:(el)=>console.log('clicked',el),
      dblclick:(el)=>console.log('double clicked',el),
      hover:(el)=>console.log('hover',el),
      hold:(el)=>console.log('hold',el),
   }
}

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.