ScoreCol.js 805 B

1234567891011121314151617181920212223242526
  1. /**
  2. * Created by Jacky.gao on 2016/9/21.
  3. */
  4. import Col from './Col.js';
  5. export default class ScoreCol extends Col{
  6. constructor(table,name,width){
  7. super(table);
  8. this.name=name;
  9. this.width=width;
  10. this.type='score';
  11. this.init();
  12. }
  13. init(){
  14. this.td=$(`<td style="width: ${this.width}px;padding-right: 0;background: #fded02;border:1px solid #607D8B"></td>`);
  15. this.td.append(this.buildColResizeTrigger());
  16. const container=$(`<span style="cursor: pointer">${this.name}</span>`);
  17. this.td.append(container);
  18. this.scoreCardTable.headerRow.append(this.td);
  19. this.bindColResize();
  20. }
  21. toXml(){
  22. let xml=" score-col-width=\""+this.width+"\" score-col-name=\""+this.name+"\"";
  23. return xml;
  24. }
  25. }