GithubHelp home page GithubHelp logo

Comments (3)

AllenFang avatar AllenFang commented on June 2, 2024

HI @gos-sebastian, I think if add link to whole row is impossible, but if cell, it work. You can use cell format to solve this problem

from react-bootstrap-table.

paulmoliva avatar paulmoliva commented on June 2, 2024

hacky way to do it:

 cellID(theCell, that){
      that.style = {
          backgroundColor: 'transparent',
          zIndex: theCell,
          minWidth: '470px',
          minHeight: '38px',
          maxHeight: '76px',
          marginRight: '-470px',
          position: 'absolute',
          content: `${theCell}`
      };
      let that2 = this;
      that.onClick = (function(){
          setTimeout(() => {
              let cell = $(`td[style*="z-index: ${theCell}"]`)
              $.each(cell, (i, el) => {
                  if(el.style['z-index'] === theCell.toString()){
                      let row = $(el).parent();
                      let theHtml = row[0].innerHTML;
                      row[0].innerHTML = `<a style='z-index: ${theCell + 1}; position: absolute; opacity: 0.2; min-height: 38px; min-width: 470px;' id="${theCell}-link" href="/campaigns/${theCell}">${theHtml}</a>`
                  }
              })
          }, 1000)
      })();
      that.title = theCell;
      return `${theCell}`;
  }

<BootstrapTable data={this.props.campaigns.campaigns} striped={true} hover={true} pagination={true} options={options}>
            <TableHeaderColumn dataField="id" isKey={true} dataFormat={function(cell){
                that.cellID(cell, this);
            }} dataAlign="center" dataSort={true}>Campaign ID</TableHeaderColumn>
              <TableHeaderColumn dataField="name" dataFormat={cell => (cell.slice(0,54) + (cell.length > 54 ? '...' : ''))} dataSort={true}>Campaign Name</TableHeaderColumn>
            <TableHeaderColumn dataField="leans" dataFormat={function(cell){
                that.cellColor(cell, this);
            }}
            dataSort={true}>Campaign Leans</TableHeaderColumn>
          </BootstrapTable>

from react-bootstrap-table.

awitherow avatar awitherow commented on June 2, 2024

@AllenFang could we revisit this issue and potentially turn it into a feature request instead of closing it?

from react-bootstrap-table.

Related Issues (20)

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.